fix: input validation for 5 API routes #277

Closed
the-dogfather-cto[bot] wants to merge 6 commits from fix/gro-624-input-validation into main
Showing only changes of commit 1bdfa9f3d2 - Show all commits
+4 -1
View File
@@ -102,7 +102,10 @@ bookRouter.get("/availability", async (c) => {
const bookingSchema = z.object({
serviceId: z.string().uuid(),
startTime: z.string().datetime(),
startTime: z.string().datetime().refine(
(dt) => new Date(dt) > new Date(),
{ message: "Appointment must be in the future" }
),
clientName: z.string().min(1).max(200),
clientEmail: z.string().email(),
clientPhone: z.string().max(50).optional(),