From 83d2cb701984826b40a3603f3bcb1cbecba9e4b5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?junh=5Feee=28=EC=9D=B4=EC=A4=80=ED=9D=AC=29?= Date: Thu, 22 Sep 2022 15:11:19 +0900 Subject: [PATCH] =?UTF-8?q?=ED=9A=8C=EC=9B=90=EA=B0=80=EC=9E=85=20?= =?UTF-8?q?=EC=83=9D=EB=85=84=EC=9B=94=EC=9D=BC=20=EC=96=91=EC=8B=9D=20val?= =?UTF-8?q?idation=20=EC=B6=94=EA=B0=80?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../account/register/AccountRegisterForm.js | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) 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({