fix select

This commit is contained in:
Chuck1sn
2025-05-19 11:19:21 +08:00
parent dd3c92172e
commit f5a57f9d69

View File

@@ -83,7 +83,7 @@ const updateFormData = (newUser: typeof user) => {
id: newUser?.id,
username: newUser?.username,
password: undefined,
enable: newUser?.enable,
enable: newUser?.enable ?? true,
confirmPassword: undefined,
};
};
@@ -102,7 +102,9 @@ const handleSubmit = async () => {
})
.min(4, "用户名至少4个字符")
.max(15, "用户名最多15个字符"),
enable: z.boolean(),
enable: z.boolean({
message: "状态不能为空",
}),
password: z
.string({
message: "密码不能为空",