Skip to content

Commit 7356a00

Browse files
jonradoffclaude
andcommitted
Fix Zod schema type mismatch with zodResolver
Remove .default() from schema fields — zodResolver uses Zod input types where .default() makes fields optional. Defaults are already provided via useForm defaultValues. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
1 parent 2669e95 commit 7356a00

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

frontend/src/pages/admin/AnnouncementsPage.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -150,8 +150,8 @@ export default function AnnouncementsPage() {
150150

151151
const announcementSchema = z.object({
152152
title: z.string().trim().min(1, 'Title is required'),
153-
body: z.string().trim().default(''),
154-
publish: z.boolean().default(false),
153+
body: z.string().trim(),
154+
publish: z.boolean(),
155155
});
156156

157157
type AnnouncementFormData = z.infer<typeof announcementSchema>;

0 commit comments

Comments
 (0)