Give trackingId a default value because if user doesnt interact with trackingId input it is not set (#6945)

This commit is contained in:
Hariom Balhara 2023-02-08 21:50:13 +05:30 committed by zomars
parent 085a44928b
commit 5bb5ac8aed
3 changed files with 3 additions and 5 deletions

View File

@ -4,7 +4,7 @@ import { eventTypeAppCardZod } from "../eventTypeAppCardZod";
export const appDataSchema = eventTypeAppCardZod.merge(
z.object({
trackingId: z.string(),
trackingId: z.string().default("").optional(),
})
);

View File

@ -4,7 +4,7 @@ import { eventTypeAppCardZod } from "../eventTypeAppCardZod";
export const appDataSchema = eventTypeAppCardZod.merge(
z.object({
trackingId: z.string(),
trackingId: z.string().default("").optional(),
})
);

View File

@ -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(),
})
);