From 8c0529cd6022e9f296023c8adc1a1cbf005e4218 Mon Sep 17 00:00:00 2001 From: Jean-Luc Makiola Date: Sun, 15 Mar 2026 17:09:59 +0100 Subject: [PATCH] fix(05-01): add imageFilename to Zod validation schemas - Root cause: Zod schemas for createItem and createCandidate did not include imageFilename field, so @hono/zod-validator silently stripped it from validated payloads before reaching the service layer - Images uploaded successfully but filename was never persisted to DB - Added imageFilename as optional string to both createItemSchema and createCandidateSchema Co-Authored-By: Claude Opus 4.6 (1M context) --- src/shared/schemas.ts | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/shared/schemas.ts b/src/shared/schemas.ts index 724a48b..71078c0 100644 --- a/src/shared/schemas.ts +++ b/src/shared/schemas.ts @@ -7,6 +7,7 @@ export const createItemSchema = z.object({ categoryId: z.number().int().positive(), notes: z.string().optional(), productUrl: z.string().url().optional().or(z.literal("")), + imageFilename: z.string().optional(), }); export const updateItemSchema = createItemSchema.partial().extend({ @@ -43,6 +44,7 @@ export const createCandidateSchema = z.object({ categoryId: z.number().int().positive(), notes: z.string().optional(), productUrl: z.string().url().optional().or(z.literal("")), + imageFilename: z.string().optional(), }); export const updateCandidateSchema = createCandidateSchema.partial();