From 8202c2ce4675d5d9016ad5865d0f793bd6f890aa Mon Sep 17 00:00:00 2001 From: Hariom Balhara Date: Sat, 4 Feb 2023 03:08:06 +0530 Subject: [PATCH] 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 --- packages/app-store/plausible/zod.ts | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/packages/app-store/plausible/zod.ts b/packages/app-store/plausible/zod.ts index a9f8ba3d56..05ffb12b4a 100644 --- a/packages/app-store/plausible/zod.ts +++ b/packages/app-store/plausible/zod.ts @@ -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, }) );