From bba36ab4c05e2a6142a2054729ca29bc7da38a73 Mon Sep 17 00:00:00 2001 From: Dotta Date: Mon, 16 Mar 2026 19:48:04 -0500 Subject: [PATCH] fix: convert archivedAt string to Date before Drizzle update The zod schema validates archivedAt as a datetime string, but Drizzle's timestamp column expects a Date object. The string was passed directly to db.update(), causing a 500 error. Now we convert the string to a Date in the route handler before calling the service. Co-Authored-By: Paperclip Co-Authored-By: Claude Opus 4.6 --- server/src/routes/projects.ts | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/server/src/routes/projects.ts b/server/src/routes/projects.ts index d9da3094..51555ff5 100644 --- a/server/src/routes/projects.ts +++ b/server/src/routes/projects.ts @@ -116,7 +116,11 @@ export function projectRoutes(db: Db) { return; } assertCompanyAccess(req, existing.companyId); - const project = await svc.update(id, req.body); + const body = { ...req.body }; + if (typeof body.archivedAt === "string") { + body.archivedAt = new Date(body.archivedAt); + } + const project = await svc.update(id, body); if (!project) { res.status(404).json({ error: "Project not found" }); return;