From 777abb225d4f8db57016a5f1e7579562e5f199f7 Mon Sep 17 00:00:00 2001 From: kangsunlee Date: Fri, 18 Jul 2025 10:24:29 +0900 Subject: [PATCH 1/2] =?UTF-8?q?[BO]=20=EC=9E=84=EA=B0=80=EB=93=B1=EB=A1=9D?= =?UTF-8?q?=20=EC=98=A4=EB=A5=98=20=EC=88=98=EC=A0=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- admin/src/main/resources/static/scripts/ajaxUtils.js | 9 ++++++++- .../main/resources/templates/households/create.html | 10 ++++++++++ 2 files changed, 18 insertions(+), 1 deletion(-) diff --git a/admin/src/main/resources/static/scripts/ajaxUtils.js b/admin/src/main/resources/static/scripts/ajaxUtils.js index eeb269e6..f23864a7 100644 --- a/admin/src/main/resources/static/scripts/ajaxUtils.js +++ b/admin/src/main/resources/static/scripts/ajaxUtils.js @@ -100,7 +100,14 @@ var ajaxUtil = { contentType : 'application/json; charset=UTF-8', async: async, statusCode : { - 400:function(){ + 400:function(rstData){ + if (options.handle422Type === 'alert') { + if (typeof errorCallback !== 'undefined') { + errorCallback(400, rstData); // 호출한 쪽에서 alert 처리 + } + return; + } + ajaxUtil._alertError(ajaxUtil.$400); }, 404:function(rstData){ diff --git a/admin/src/main/resources/templates/households/create.html b/admin/src/main/resources/templates/households/create.html index 5b985079..56f3ce07 100644 --- a/admin/src/main/resources/templates/households/create.html +++ b/admin/src/main/resources/templates/households/create.html @@ -342,6 +342,11 @@ const checkHouseholdNum = () => { const f = document.reqForm; + if($('#householdNum').val() === '') { + alert('임가번호를 입력해주세요.'); + return; + } + ajaxUtil._ajaxMethod( '/api/households/check', { householdNum : f.householdNum.value }, @@ -381,8 +386,13 @@ function(response) { // 성공 alert("등록이 완료되었습니다."); location.href = '/households'; + console.log("code", response) + }, function (code, rstData) { + console.log("code", code) + console.log("rstData", rstData) + if(code == 422) alert(rstData.responseText); if(code == 400) alert(rstData.responseJSON.message); //임가번호 중복체크 }, From 151f657c515efbc53005067c0a9c565b0da09199 Mon Sep 17 00:00:00 2001 From: kangsunlee Date: Fri, 18 Jul 2025 10:53:04 +0900 Subject: [PATCH 2/2] =?UTF-8?q?[BO]=20=EC=9E=84=EA=B0=80=EB=93=B1=EB=A1=9D?= =?UTF-8?q?=20=EC=97=90=EB=9F=AC=20=EC=88=98=EC=A0=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../resources/mappers/household/CreateHouseholdMapper.xml | 8 -------- 1 file changed, 8 deletions(-) diff --git a/admin/src/main/resources/mappers/household/CreateHouseholdMapper.xml b/admin/src/main/resources/mappers/household/CreateHouseholdMapper.xml index f053eee5..fc94174b 100644 --- a/admin/src/main/resources/mappers/household/CreateHouseholdMapper.xml +++ b/admin/src/main/resources/mappers/household/CreateHouseholdMapper.xml @@ -45,18 +45,10 @@ #{regionSubCode}, #{regionDetailCode}, #{address}, - #{industryLargeCode}, - - #{industryMiddleCode}, - - #{industrySubMiddle}, - - #{industryDetail}, - #{isPanel}, #{usageType}, #{employmentType},