Hotfix: For old Plausible installs enabled in an EventType, give a default value (#6860)

* Add default for trackingId for old plausible installs in event-types

* Fix types
This commit is contained in:
Hariom Balhara
2023-02-03 21:38:06 +00:00
committed by GitHub
parent 9b26c7aee6
commit 75509c97fd
+3 -1
View File
@@ -4,7 +4,9 @@ import { eventTypeAppCardZod } from "../eventTypeAppCardZod";
export const appDataSchema = eventTypeAppCardZod.merge(
z.object({
trackingId: z.string(),
// 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,
})
);