From aa57008ff9173d60e15f288d4210f498ca14b72c Mon Sep 17 00:00:00 2001 From: matushl Date: Sat, 11 Nov 2023 13:36:28 +0100 Subject: [PATCH] remove async/await where wasn't neccesary --- src/components/PageLayout/LoginForm/LoginForm.tsx | 4 ++-- src/components/Profile/ProfileForm.tsx | 2 +- src/components/RegisterForm/RegisterForm.tsx | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/src/components/PageLayout/LoginForm/LoginForm.tsx b/src/components/PageLayout/LoginForm/LoginForm.tsx index 2bed7b6c..12e67c3e 100644 --- a/src/components/PageLayout/LoginForm/LoginForm.tsx +++ b/src/components/PageLayout/LoginForm/LoginForm.tsx @@ -24,8 +24,8 @@ export const LoginForm: FC = ({closeOverlay}) => { const {login} = AuthContainer.useContainer() const {handleSubmit, control} = useForm({defaultValues}) - const onSubmit: SubmitHandler = async (data) => { - await login({data, onSuccess: closeOverlay}) + const onSubmit: SubmitHandler = (data) => { + login({data, onSuccess: closeOverlay}) } const requiredRule = {required: '* Toto pole nemôže byť prázdne.'} diff --git a/src/components/Profile/ProfileForm.tsx b/src/components/Profile/ProfileForm.tsx index 5ac8557c..73e78afb 100644 --- a/src/components/Profile/ProfileForm.tsx +++ b/src/components/Profile/ProfileForm.tsx @@ -92,7 +92,7 @@ export const ProfileForm: FC = () => { onSuccess: () => router.push(`/${seminar}/profil`), }) - const onSubmit: SubmitHandler = async (data) => { + const onSubmit: SubmitHandler = (data) => { submitFormData(data) } diff --git a/src/components/RegisterForm/RegisterForm.tsx b/src/components/RegisterForm/RegisterForm.tsx index 44abb859..90bdc2fc 100644 --- a/src/components/RegisterForm/RegisterForm.tsx +++ b/src/components/RegisterForm/RegisterForm.tsx @@ -80,7 +80,7 @@ export const RegisterForm: FC = () => { onSuccess: () => router.push(`${router.asPath}/../verifikacia`), }) - const onSubmit: SubmitHandler = async (data) => { + const onSubmit: SubmitHandler = (data) => { submitFormData(data) }