diff --git a/src/pages/login/components/LoginEmailForm.tsx b/src/pages/login/components/LoginEmailForm.tsx index 8e8a2ec..bf21578 100644 --- a/src/pages/login/components/LoginEmailForm.tsx +++ b/src/pages/login/components/LoginEmailForm.tsx @@ -15,7 +15,7 @@ import useAxios from "../../../hooks/useAxios"; const LoginEmailForm = () => { const dispatch = useDispatch(); const navigate = useNavigate(); - const axios = useAxios() + const axios = useAxios(); const mutationEmail = useMutation({ mutationFn: (values: { email: string; password: string }) => { return axios.post("/login", values); @@ -27,8 +27,12 @@ const LoginEmailForm = () => { password: "", }, validationSchema: Yup.object({ - email: Yup.string().email("ایمیل نامعتبر است"), - password: Yup.string().min(6, "رمز عبور حداقل باید 6 کاراکتر باشد"), + email: Yup.string() + .email("ایمیل نامعتبر است") + .required("این فیلد الزامی است"), + password: Yup.string() + .min(6, "رمز عبور حداقل باید 6 کاراکتر باشد") + .required("این فیلد الزامی است"), }), onSubmit: (values) => { toast.promise(mutationEmail.mutateAsync(values), { @@ -107,7 +111,8 @@ const LoginEmailForm = () => { -
+
+ diff --git a/src/pages/login/components/LoginMobileForm.tsx b/src/pages/login/components/LoginMobileForm.tsx index ed75648..2c6a3fd 100644 --- a/src/pages/login/components/LoginMobileForm.tsx +++ b/src/pages/login/components/LoginMobileForm.tsx @@ -54,7 +54,7 @@ const LoginMobileForm = ({ loading: "در حال ارسال کد...", success: (res) => { dispatch(setToken(res?.data?.result?.token)); - setisShowLoginNumberOrEmail(false) + setisShowLoginNumberOrEmail(false); setStepMobile(2); return `${res.data.alert}`; }, @@ -223,7 +223,8 @@ const LoginMobileForm = ({ ) )}
-
+
+