From 3b28f7c6538a2654324c24c8831e289770caec8f Mon Sep 17 00:00:00 2001 From: Emir Karabeg Date: Mon, 3 Mar 2025 21:04:33 -0800 Subject: [PATCH] fix(db-sync): runtime type error --- app/api/db/workflow/route.ts | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/app/api/db/workflow/route.ts b/app/api/db/workflow/route.ts index f3326b737c..845baf075f 100644 --- a/app/api/db/workflow/route.ts +++ b/app/api/db/workflow/route.ts @@ -12,7 +12,10 @@ const WorkflowStateSchema = z.object({ loops: z.record(z.any()), lastSaved: z.number().optional(), isDeployed: z.boolean().optional(), - deployedAt: z.date().optional(), + deployedAt: z + .union([z.string(), z.date()]) + .optional() + .transform((val) => (typeof val === 'string' ? new Date(val) : val)), }) const WorkflowSchema = z.object({