fix(repairs): Log repair submit silently ignored with empty defaults
CI / Lint · Typecheck · Test · Build (push) Successful in 45s
CI / Playwright (smoke) (push) Has been skipped
CI / Build & push images (push) Successful in 1m9s

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 <noreply@anthropic.com>
This commit is contained in:
2026-04-17 15:50:24 -04:00
parent a2b088463d
commit e60d049e69
@@ -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(),