From 651044f2897dd417949930738c5f7612da78e84c Mon Sep 17 00:00:00 2001 From: ddshi <8811906+ddshi@user.noreply.gitee.com> Date: Mon, 2 Mar 2026 17:37:49 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20=E4=BF=AE=E5=A4=8D=20reminder=5Ftimes=20?= =?UTF-8?q?=E4=B8=BA=20null=20=E5=AF=BC=E8=87=B4=E7=9A=84=20500=20?= =?UTF-8?q?=E9=94=99=E8=AF=AF?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - Zod schema 允许 reminder_times 为 null - events.ts 和 ai.ts 中的 schema 都添加 .nullable() Co-Authored-By: Claude Opus 4.6 --- src/routes/ai.ts | 2 +- src/routes/events.ts | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/routes/ai.ts b/src/routes/ai.ts index 3193087..f00adb8 100644 --- a/src/routes/ai.ts +++ b/src/routes/ai.ts @@ -162,7 +162,7 @@ const parsedEventSchema = z.object({ content: z.string().optional(), // 详细内容(仅提醒) is_holiday: z.boolean().optional(), // 节假日(仅纪念日) priority: z.enum(['none', 'red', 'green', 'yellow']).optional(), // 颜色(仅提醒) - reminder_times: z.array(z.string()).optional(), // 提前提醒时间点 + reminder_times: z.array(z.string()).optional().nullable(), // 提前提醒时间点 }); // All routes require authentication diff --git a/src/routes/events.ts b/src/routes/events.ts index e920f8a..5f6acf2 100644 --- a/src/routes/events.ts +++ b/src/routes/events.ts @@ -52,7 +52,7 @@ const createEventSchema = z.object({ is_holiday: z.boolean().default(false), is_completed: z.boolean().default(false), priority: z.enum(['none', 'red', 'green', 'yellow']).default('none'), - reminder_times: z.array(z.string()).optional(), // 提醒时间点数组(JSON) + reminder_times: z.array(z.string()).optional().nullable(), // 提醒时间点数组(JSON) }); const updateEventSchema = createEventSchema.partial();