mirror of
https://github.com/hanzoai/calendar.git
synced 2026-09-24 22:42:24 +00:00
* fix #21709: change to error on schedule name empty save * fix comments * minor enahncemnts --------- Co-authored-by: Volnei Munhoz <[email protected]> Co-authored-by: Anik Dhabal Babu <[email protected]>
23 lines
489 B
TypeScript
23 lines
489 B
TypeScript
import { z } from "zod";
|
|
|
|
export type TCreateInputSchema = {
|
|
name: string;
|
|
schedule?: { start: Date; end: Date }[][];
|
|
eventTypeId?: number;
|
|
};
|
|
|
|
export const ZCreateInputSchema: z.ZodType<TCreateInputSchema> = z.object({
|
|
name: z.string().trim().min(1, "Schedule name cannot be empty"),
|
|
schedule: z
|
|
.array(
|
|
z.array(
|
|
z.object({
|
|
start: z.date(),
|
|
end: z.date(),
|
|
})
|
|
)
|
|
)
|
|
.optional(),
|
|
eventTypeId: z.number().optional(),
|
|
});
|