fix: restore error handling logic in form submission process

This commit is contained in:
faisolavolut 2025-02-26 10:55:42 +07:00
parent 6c311f4b2e
commit 21c57270f4
1 changed files with 5 additions and 6 deletions

View File

@ -152,12 +152,11 @@ export const Form: React.FC<any> = ({
local.error = error;
local.render();
console.log(isError);
// if (isError) {
// throw new Error("please check your input field.");
// } else {
// await onSubmit(local);
// }
if (isError) {
throw new Error("please check your input field.");
} else {
await onSubmit(local);
}
setTimeout(() => {
toast.success(
<div