From b4f32bccad93a47e90009485c02de0639157bef8 Mon Sep 17 00:00:00 2001 From: moist-webDev Date: Thu, 8 Jun 2023 21:10:11 -0400 Subject: [PATCH] add presubmitschema for other --- lib/schemas.ts | 15 +++++++++++++-- 1 file changed, 13 insertions(+), 2 deletions(-) diff --git a/lib/schemas.ts b/lib/schemas.ts index ebeb77f..cd6c6d1 100644 --- a/lib/schemas.ts +++ b/lib/schemas.ts @@ -46,13 +46,24 @@ export type Show = z.infer; export const ShowsSchema = z.array(ShowSchema); export type Shows = z.infer; +export const PreSubmitOtherSchema = z.object({ + title: z.string().min(1).max(255), + notes: z.string().min(0).max(255), + completeState: z.number().min(0).max(2).default(0), + rating: z.number().min(0).max(5).default(0), + currentSeason: z.number().min(0).max(1000).default(0), + currentEpisode: z.number().min(0).max(1000).default(0), + category: z.number() +}).strict(); +export type PreSubmitOther = z.infer; + export const OtherSchema = z.object({ id: z.number(), - title: z.string(), + title: z.string().min(1).max(255), //conpleteState TBD = 0 | In Progress = 1 | Completed = 2 completeState: z.number().min(0).max(2), rating: z.number().min(0).max(5).default(0), - notes: z.string().optional(), + notes: z.string().min(0).max(255), currentSeason: z.number().min(0).max(1000).default(0), currentEpisode: z.number().min(0).max(1000).default(0), category: z.number(),