diff --git a/src/routes/events.ts b/src/routes/events.ts index ce4de35..e920f8a 100644 --- a/src/routes/events.ts +++ b/src/routes/events.ts @@ -47,7 +47,7 @@ const createEventSchema = z.object({ date: z.string().optional(), // Can be empty string for reminders is_lunar: z.boolean().default(false), repeat_type: z.enum(['daily', 'weekly', 'monthly', 'yearly', 'none']).default('none'), - repeat_interval: z.number().int().positive().optional().nullable(), // 自定义间隔(周数) + repeat_interval: z.number().int().min(1).optional().nullable(), // 自定义间隔(周数) next_reminder_date: z.string().optional().nullable(), // 下一次提醒日期 is_holiday: z.boolean().default(false), is_completed: z.boolean().default(false), @@ -189,6 +189,7 @@ router.put( } const data = updateEventSchema.parse(req.body); + console.log('[Update Event] Request body:', JSON.stringify(req.body)); // Build dynamic update query const updates: string[] = [];