Give trackingId a default value because if user doesnt interact with trackingId input it is not set (#6945)
This commit is contained in:
parent
3345ec61ee
commit
9cad7086d7
|
@ -4,7 +4,7 @@ import { eventTypeAppCardZod } from "../eventTypeAppCardZod";
|
|||
|
||||
export const appDataSchema = eventTypeAppCardZod.merge(
|
||||
z.object({
|
||||
trackingId: z.string(),
|
||||
trackingId: z.string().default("").optional(),
|
||||
})
|
||||
);
|
||||
|
||||
|
|
|
@ -4,7 +4,7 @@ import { eventTypeAppCardZod } from "../eventTypeAppCardZod";
|
|||
|
||||
export const appDataSchema = eventTypeAppCardZod.merge(
|
||||
z.object({
|
||||
trackingId: z.string(),
|
||||
trackingId: z.string().default("").optional(),
|
||||
})
|
||||
);
|
||||
|
||||
|
|
|
@ -4,9 +4,7 @@ import { eventTypeAppCardZod } from "../eventTypeAppCardZod";
|
|||
|
||||
export const appDataSchema = eventTypeAppCardZod.merge(
|
||||
z.object({
|
||||
// FIXME: Due to some reason autogenerated zod schema at prisma/zod/eventtype.ts fails typecheck on using `.default()`. It somehow thinks that trackingId can be undefined
|
||||
// z.lazy has something to do with it. Figure it out later.
|
||||
trackingId: z.string().default("") as unknown as z.ZodString,
|
||||
trackingId: z.string().default("").optional(),
|
||||
})
|
||||
);
|
||||
|
||||
|
|
Loading…
Reference in New Issue
Block a user