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 authored and GitHub committed 2023-02-08 16:20:13 +00:00
1 parent 3345ec61ee
commit 9cad7086d7
3 files changed
+3 -5

No files matched your search

+1 -1
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(),
})
);
+1 -1
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(),
})
);
+1 -3
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(),
})
);