diff --git a/src/app/parent/child-manage.tsx b/src/app/parent/child-manage.tsx index 88f73e4..d835b09 100644 --- a/src/app/parent/child-manage.tsx +++ b/src/app/parent/child-manage.tsx @@ -18,8 +18,8 @@ export function ChildManage({ kids }: { kids: { id: number; name: string }[] }) const fd = new FormData(); fd.set("name", name); startTransition(async () => { - const r = await addChild(fd); - if (r?.error) setMsg(r.error); + const err = await addChild(fd); + if (err) setMsg(err); else { setName(""); setMsg("已添加,用孩子设备激活即可");