cal.pub0.org/lib/validations/availability.ts

24 lines
528 B
TypeScript
Raw Normal View History

import { withValidation } from "next-validations";
import { z } from "zod";
const schemaAvailability = z
.object({
2022-03-27 13:15:46 +00:00
id: z.number(),
userId: z.number(),
eventTypeId: z.number(),
scheduleId: z.number(),
days: z.array(z.number()),
date: z.date().or(z.string()),
startTime: z.string(),
endTime: z.string(),
})
.strict();
const withValidAvailability = withValidation({
schema: schemaAvailability,
type: "Zod",
mode: "body",
});
export { schemaAvailability, withValidAvailability };