From 0a0ffd5f21170b269d00ce6cad1381223b534154 Mon Sep 17 00:00:00 2001 From: swcho Date: Tue, 11 Nov 2025 16:49:44 +0900 Subject: [PATCH] =?UTF-8?q?fix:=20-=20=EC=A4=91=EC=A0=90=EC=9A=B0=EC=88=98?= =?UTF-8?q?=ED=86=A0=EC=8B=A4=20=EC=9A=B4=EC=98=81=EC=A0=95=EB=B3=B4=20?= =?UTF-8?q?=ED=98=B8=EC=B6=9C=20API=20=EC=88=98=EC=A0=95=20-=20Search=20Mo?= =?UTF-8?q?dal=20Tab=20=EB=9D=84=EC=96=B4=EC=93=B0=EA=B8=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../map/components/popupComponent/Ssc.tsx | 17 ++++++++++++++++- .../map/searchModal/useSearchModal.ts | 4 ++-- 2 files changed, 18 insertions(+), 3 deletions(-) diff --git a/apps/sn/app/(map-layout)/map/components/popupComponent/Ssc.tsx b/apps/sn/app/(map-layout)/map/components/popupComponent/Ssc.tsx index d55e1c9c2..b488e4d79 100644 --- a/apps/sn/app/(map-layout)/map/components/popupComponent/Ssc.tsx +++ b/apps/sn/app/(map-layout)/map/components/popupComponent/Ssc.tsx @@ -65,7 +65,22 @@ const Ssc = ({ featureData, isMainSsc, chmbrXcnts, chmbrYdnts, onSaveClick }: { size: '3', }); - const result = await getData(`v1/onsemiro/getSwgRainsByGeomety?${queryParams.toString()}`); + let result; + const res = await fetch(`/sewerage-service/api/v1/onsemiro/getSwgRainsByGeomety?${queryParams.toString()}`, { + method: "GET", + }); + if (res.ok) { + // 응답이 비어있는지 확인 + const contentLength = res.headers.get('content-length'); + if (contentLength === '0') result = null; + + // 응답 텍스트를 먼저 가져와서 빈 문자열인지 확인 + const text = await res.text(); + if (!text || text.trim() === '') result = null; + + // JSON 파싱 시도 + result = JSON.parse(text); + } const processedDataArray: any[] = result.content.map((data: any) => { // 🎯 formatDisplayData로 기본 포맷팅 적용 diff --git a/apps/sn/app/(map-layout)/map/searchModal/useSearchModal.ts b/apps/sn/app/(map-layout)/map/searchModal/useSearchModal.ts index eb00b5f19..1d317e3d4 100644 --- a/apps/sn/app/(map-layout)/map/searchModal/useSearchModal.ts +++ b/apps/sn/app/(map-layout)/map/searchModal/useSearchModal.ts @@ -43,9 +43,9 @@ export default function useSearchModal() { const { BIZ_TY_CD } = useStore(); const TABS = [ - { val: "basic", text: "기본정보" }, + { val: "basic", text: "기본 정보" }, { val: "operation", text: "유지관리 정보" }, - { val: "report", text: "하수도정비기본계획보고서" }, + { val: "report", text: "하수도 정비 기본계획 보고서" }, ]; // 검색 API 호출 함수