fix command type

This commit is contained in:
Chuck1sn
2025-05-26 11:27:00 +08:00
parent dde5fecd62
commit 3f4a5f2e8b
8 changed files with 106 additions and 44 deletions

View File

@@ -130,19 +130,10 @@ const handleSubmit = async () => {
},
);
try {
const validatedData = userSchema.parse(formData.value);
await onSubmit(validatedData);
updateFormData(undefined);
} catch (error) {
if (error instanceof z.ZodError) {
alertStore.showAlert({
level: "error",
content: error.errors[0].message,
});
}
throw error;
}
};
onMounted(() => {