diff --git a/src/components/account/register/AccountRegisterForm.js b/src/components/account/register/AccountRegisterForm.js index e22d41a7..c427e33e 100644 --- a/src/components/account/register/AccountRegisterForm.js +++ b/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({