From 74e85edd339ef5dc838cd42a673735733f7b34c8 Mon Sep 17 00:00:00 2001 From: cfngc4594 Date: Wed, 2 Apr 2025 09:27:05 +0800 Subject: [PATCH] feat(admin/problemset): add schema definition for new problem --- .../features/dashboard/admin/problemset/new/schema.ts | 11 +++++++++++ 1 file changed, 11 insertions(+) create mode 100644 src/components/features/dashboard/admin/problemset/new/schema.ts diff --git a/src/components/features/dashboard/admin/problemset/new/schema.ts b/src/components/features/dashboard/admin/problemset/new/schema.ts new file mode 100644 index 0000000..764218c --- /dev/null +++ b/src/components/features/dashboard/admin/problemset/new/schema.ts @@ -0,0 +1,11 @@ +import { z } from "zod"; +import { ProblemSchema } from "@/generated/zod"; + +export const problemSchema = ProblemSchema.extend({ + displayId: z.coerce.number().int().positive().min(1), + title: z.string().min(1), + description: z.string().min(1), + solution: z.string().min(1), +}); + +export type ProblemSchema = z.infer;