add presubmitschema for other

This commit is contained in:
moist-webDev 2023-06-08 21:10:11 -04:00
parent 48fc498a5e
commit b4f32bccad
1 changed files with 13 additions and 2 deletions

View File

@ -46,13 +46,24 @@ export type Show = z.infer<typeof ShowSchema>;
export const ShowsSchema = z.array(ShowSchema); export const ShowsSchema = z.array(ShowSchema);
export type Shows = z.infer<typeof ShowsSchema>; export type Shows = z.infer<typeof ShowsSchema>;
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<typeof PreSubmitOtherSchema>;
export const OtherSchema = z.object({ export const OtherSchema = z.object({
id: z.number(), id: z.number(),
title: z.string(), title: z.string().min(1).max(255),
//conpleteState TBD = 0 | In Progress = 1 | Completed = 2 //conpleteState TBD = 0 | In Progress = 1 | Completed = 2
completeState: z.number().min(0).max(2), completeState: z.number().min(0).max(2),
rating: z.number().min(0).max(5).default(0), 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), currentSeason: z.number().min(0).max(1000).default(0),
currentEpisode: z.number().min(0).max(1000).default(0), currentEpisode: z.number().min(0).max(1000).default(0),
category: z.number(), category: z.number(),