Browse Source

회원가입 생년월일 양식 validation 추가

pull/2/head
junh_eee(이준희) 2 years ago
parent
commit
83d2cb7019
  1. 14
      src/components/account/register/AccountRegisterForm.js

14
src/components/account/register/AccountRegisterForm.js

@ -94,13 +94,13 @@ export const AccountRegisterForm = ({
});
return;
}
if(vData.hpno.length < 11) {
if (vData.hpno.length < 11) {
setModal({
isOpen: true,
title: '인증번호 발송',
desc: '올바른 번호를 입력해 주세요.',
color: 'modal-danger'
})
});
return;
}
@ -159,7 +159,13 @@ export const AccountRegisterForm = ({
// ),
userPswd: yup.string().required('비밀번호를 입력해 주세요.'),
genderCd: yup.string().required('성별을 선택해 주세요.'),
brthdyDate: yup.string().required('생년월일을 입력해 주세요.'),
brthdyDate: yup
.string()
.required('생년월일을 입력해 주세요.')
.matches(
/^(19[0-9][0-9]|20\d{2})(0[0-9]|1[0-2])(0[1-9]|[1-2][0-9]|3[0-1])$/,
'올바른 생년월일을 입력해 주세요.'
),
memberName: yup
.string()
.required('이름을 입력해 주세요.')
@ -221,7 +227,7 @@ export const AccountRegisterForm = ({
agreeTerms: agreeTerms
});
// console.log(res);
// console.log(res);
if (res.data?.errCode === -1) {
setModal({

Loading…
Cancel
Save