From 9c92ae6d7203f50c7c6173aa3454236b2f115152 Mon Sep 17 00:00:00 2001 From: sanguu Date: Mon, 26 Sep 2022 16:04:27 +0900 Subject: [PATCH] =?UTF-8?q?=EA=B8=B0=EC=B2=B4=EB=AA=A9=EB=A1=9D(=EC=9C=A0?= =?UTF-8?q?=ED=9A=A8=EC=84=B1=20=EC=88=98=EC=A0=95)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../basis/dron/BasisIdntfContainer.js | 33 ++++++++++--------- 1 file changed, 18 insertions(+), 15 deletions(-) diff --git a/src/containers/basis/dron/BasisIdntfContainer.js b/src/containers/basis/dron/BasisIdntfContainer.js index 6297ce91..eea72584 100644 --- a/src/containers/basis/dron/BasisIdntfContainer.js +++ b/src/containers/basis/dron/BasisIdntfContainer.js @@ -63,62 +63,64 @@ export const BasisIdntfContainer = props => { const check_num = /[0-9]/; const check_kor = /^[가-힣a-zA-Z0-9][^!@#$%^&*()+\=\[\]{};':"\\|,.<>\/?\s]*$/; - if (!check_num.test(idntf.hpno)) { + + + if (!idntf.idntfNum && idntf.idntfNum === '') { setModal({ isOpen: true, title: '필수값 입력 오류', - desc: '연락처에 숫자만 입력해주세요.' + desc: '식별번호를 입력해 주세요.' }); checking = false; return false; - } - if (!check_kor.test(idntf.idntfNum)) { + if (!idntf.ownerNm && idntf.ownerNm === '') { setModal({ isOpen: true, title: '필수값 입력 오류', - desc: '식별번호에 지원되지 않는 특수문자입니다.' + desc: '소유자명을 입력해 주세요.' }); checking = false; return false; - } - if (!check_kor.test(idntf.ownerNm)) { + if (!idntf.hpno && idntf.hpno === '') { setModal({ isOpen: true, title: '필수값 입력 오류', - desc: '소유자명에 지원되지 않는 특수문자입니다.' + desc: '연락처를 입력해 주세요.' }); checking = false; return false; - } - if (!idntf.idntfNum && idntf.idntfNum === '') { + if (!check_kor.test(idntf.idntfNum)) { setModal({ isOpen: true, title: '필수값 입력 오류', - desc: '식별번호를 입력해 주세요.' + desc: '식별번호에 지원되지 않는 특수문자입니다.' }); checking = false; return false; } - if (!idntf.ownerNm && idntf.ownerNm === '') { + + if (!check_kor.test(idntf.ownerNm)) { setModal({ isOpen: true, title: '필수값 입력 오류', - desc: '소유자명을 입력해 주세요.' + desc: '소유자명에 지원되지 않는 특수문자입니다.' }); checking = false; return false; + } - if (!idntf.hpno && idntf.hpno === '') { + if (!check_num.test(idntf.hpno)) { setModal({ isOpen: true, title: '필수값 입력 오류', - desc: '연락처를 입력해 주세요.' + desc: '연락처에 숫자만 입력해주세요.' }); checking = false; return false; + } }); @@ -138,6 +140,7 @@ export const BasisIdntfContainer = props => { }); return false; } + }; const handlerDelete = async data => {