From a4a9e0889a6ad7461e432832e0f5fa47ec444eb9 Mon Sep 17 00:00:00 2001 From: imbytecat Date: Sat, 17 Jan 2026 03:10:19 +0800 Subject: [PATCH] =?UTF-8?q?refactor:=20=E4=BC=98=E5=8C=96=E9=AA=8C?= =?UTF-8?q?=E8=AF=81=E6=A8=A1=E5=BC=8F=EF=BC=8C=E7=9B=B4=E6=8E=A5=E4=BD=BF?= =?UTF-8?q?=E7=94=A8=20UUID=20=E7=B1=BB=E5=9E=8B=E6=8F=90=E5=8D=87?= =?UTF-8?q?=E6=A0=A1=E9=AA=8C=E5=87=86=E7=A1=AE=E6=80=A7?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - 优化验证模式,移除字符串类型转换,直接使用 UUID 类型以提升数据校验准确性。 --- src/routes/todo.tsx | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/src/routes/todo.tsx b/src/routes/todo.tsx index 69cc967..468661f 100644 --- a/src/routes/todo.tsx +++ b/src/routes/todo.tsx @@ -8,18 +8,17 @@ import { z } from 'zod' import { db } from '@/db' import { todoTable } from '@/db/schema' -// Zod Schemas const createTodoSchema = z.object({ title: z.string().min(1, '标题不能为空'), }) const updateTodoSchema = z.object({ - id: z.string().uuid(), + id: z.uuid(), completed: z.boolean(), }) const deleteTodoSchema = z.object({ - id: z.string().uuid(), + id: z.uuid(), }) // Server Functions - CRUD 操作