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-04 03:08:06 +05:30 committed by zomars
parent 19b595b93f
commit 8202c2ce46

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