Skip to content

Commit

Permalink
fix: fixed unable to add repeating events
Browse files Browse the repository at this point in the history
  • Loading branch information
ImJustChew committed Sep 28, 2024
1 parent 8046314 commit 4198fa8
Showing 1 changed file with 20 additions and 7 deletions.
27 changes: 20 additions & 7 deletions src/components/Calendar/eventFormSchema.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -15,14 +15,27 @@ const schemaDetails = z.object({
details: z.string().optional(),
location: z.string().optional(),
allDay: z.boolean(),
repeat: z.union([
repeat: z.discriminatedUnion("type", [
z.object({
type: z.union([
z.literal("daily"),
z.literal("weekly"),
z.literal("monthly"),
z.literal("yearly"),
]),
type: z.literal("daily"),
interval: z.number(),
mode: z.union([z.literal("count"), z.literal("date")]),
value: z.number(),
}),
z.object({
type: z.literal("weekly"),
interval: z.number(),
mode: z.union([z.literal("count"), z.literal("date")]),
value: z.number(),
}),
z.object({
type: z.literal("monthly"),
interval: z.number(),
mode: z.union([z.literal("count"), z.literal("date")]),
value: z.number(),
}),
z.object({
type: z.literal("yearly"),
interval: z.number(),
mode: z.union([z.literal("count"), z.literal("date")]),
value: z.number(),
Expand Down

0 comments on commit 4198fa8

Please sign in to comment.