From e60d049e693b63aa353fb672440492d1d26caf6a Mon Sep 17 00:00:00 2001 From: josh Date: Fri, 17 Apr 2026 15:50:24 -0400 Subject: [PATCH] fix(repairs): Log repair submit silently ignored with empty defaults MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The broken-model UUID fields used z.string().uuid().optional(), which only accepts undefined — not the '' defaults. When the broken serial matched an existing part, those fields unmounted before their FormMessage could render, so handleSubmit aborted on hidden errors and the mutation never fired. Accept the empty-string sentinel alongside UUIDs. Co-Authored-By: Claude Opus 4.7 --- apps/web/src/components/repairs/LogRepairDialog.tsx | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/apps/web/src/components/repairs/LogRepairDialog.tsx b/apps/web/src/components/repairs/LogRepairDialog.tsx index 645670e..1b6fd49 100644 --- a/apps/web/src/components/repairs/LogRepairDialog.tsx +++ b/apps/web/src/components/repairs/LogRepairDialog.tsx @@ -44,9 +44,9 @@ const Schema = z .object({ hostId: z.string().uuid('Pick a host'), brokenSerial: z.string().trim().min(1, 'Required').max(128), - brokenPartModelId: z.string().uuid().optional(), + brokenPartModelId: z.union([z.literal(''), z.string().uuid()]).optional(), brokenMpn: z.string().trim().max(128).optional(), - brokenManufacturerId: z.string().uuid().optional(), + brokenManufacturerId: z.union([z.literal(''), z.string().uuid()]).optional(), replacementSerial: z.string().trim().min(1, 'Required').max(128), fmId: z.string().optional(), brokenExists: z.boolean().optional(),