minor fix, validates the number is between 0 and 10

This commit is contained in:
root 2025-03-11 00:08:18 -05:00
parent 3ea2d71d0b
commit 2c6666494b

View file

@ -4,7 +4,7 @@ import { z } from 'zod';
const userRatingsSchema = z.object({ const userRatingsSchema = z.object({
tmdb_id: z.number(), tmdb_id: z.number(),
type: z.enum(['movie', 'tv']), type: z.enum(['movie', 'tv']),
rating: z.number() rating: z.number().min(0).max(10)
}); });
export default defineEventHandler(async (event) => { export default defineEventHandler(async (event) => {