From 21c57270f4ac3c1b729e06e8b9bad1c99be6a82d Mon Sep 17 00:00:00 2001 From: faisolavolut Date: Wed, 26 Feb 2025 10:55:42 +0700 Subject: [PATCH] fix: restore error handling logic in form submission process --- components/form/Form.tsx | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/components/form/Form.tsx b/components/form/Form.tsx index f2c7c17..6298ad4 100644 --- a/components/form/Form.tsx +++ b/components/form/Form.tsx @@ -152,12 +152,11 @@ export const Form: React.FC = ({ 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(