Commit 5f9f71fb authored by Choi Ga Young's avatar Choi Ga Young
Browse files

세부사항 수정

parent dbc0e71e
...@@ -25,7 +25,7 @@ const LoginForm = () => { ...@@ -25,7 +25,7 @@ const LoginForm = () => {
password: Yup.string() password: Yup.string()
.required('비밀번호를 입력해주세요.'), .required('비밀번호를 입력해주세요.'),
})} })}
onSubmit={async (values, { setSubmitting }) => { onSubmit={async (values, { setSubmitting, resetForm }) => {
try { try {
setError("") setError("")
const result = await authApi.login(values) const result = await authApi.login(values)
...@@ -34,6 +34,7 @@ const LoginForm = () => { ...@@ -34,6 +34,7 @@ const LoginForm = () => {
} }
} catch (error) { } catch (error) {
catchErrors(error, setError) catchErrors(error, setError)
resetForm();
} }
setTimeout(() => { setTimeout(() => {
setSubmitting(false); setSubmitting(false);
......
...@@ -44,7 +44,7 @@ const SignupForm = () => { ...@@ -44,7 +44,7 @@ const SignupForm = () => {
.required('학번을 입력해주세요.') .required('학번을 입력해주세요.')
.min(7, '학번을 정확히 입력해주세요.'), .min(7, '학번을 정확히 입력해주세요.'),
})} })}
onSubmit={async (values, { setSubmitting }) => { onSubmit={async (values, { setSubmitting, resetForm }) => {
try { try {
setError("") setError("")
const result = await authApi.signup(values) const result = await authApi.signup(values)
...@@ -55,6 +55,7 @@ const SignupForm = () => { ...@@ -55,6 +55,7 @@ const SignupForm = () => {
} }
} catch (error) { } catch (error) {
catchErrors(error, setError) catchErrors(error, setError)
resetForm();
} }
setTimeout(() => { setTimeout(() => {
setSubmitting(false); setSubmitting(false);
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment