Skip to content

Commit

Permalink
feat; isFormError 상태값 변경
Browse files Browse the repository at this point in the history
  • Loading branch information
kimeodml committed Jul 23, 2024
1 parent a99a735 commit 1565eae
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions src/page/Auth/Login/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -38,14 +38,17 @@ export default function Login() {
const onSubmit: SubmitHandler<LoginParams> = async (data) => {
if (data.account === '') {
setLoginError('전화번호를 입력해주세요.');
setIsFormError(true);
return;
}
if (data.password === '') {
setLoginError('비밀번호를 입력해주세요.');
setIsFormError(true);
return;
}
if (!/^[0-9]*$/.test(data.account)) {
setLoginError('올바른 전화번호 형식이 아닙니다.');
setIsFormError(true);
return;
}
const hashedPassword = await sha256(data.password);
Expand Down

0 comments on commit 1565eae

Please sign in to comment.