From e285210927301ea0187b4d5b081da842ef28436b Mon Sep 17 00:00:00 2001 From: ysCha Date: Tue, 5 Aug 2025 11:29:06 +0900 Subject: [PATCH] =?UTF-8?q?=EC=A7=80=EB=B6=95=EC=9E=AC=EC=84=A0=ED=83=9D?= =?UTF-8?q?=20=EB=A9=94=EB=89=B4=EC=9D=98=20=EB=8D=B0=EC=9D=B4=ED=84=B0=20?= =?UTF-8?q?=EB=8F=99=EA=B8=B0=ED=99=94?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../roofcover/useRoofAllocationSetting.js | 37 +++++++++++-------- 1 file changed, 22 insertions(+), 15 deletions(-) diff --git a/src/hooks/roofcover/useRoofAllocationSetting.js b/src/hooks/roofcover/useRoofAllocationSetting.js index db39ac3a..417286e4 100644 --- a/src/hooks/roofcover/useRoofAllocationSetting.js +++ b/src/hooks/roofcover/useRoofAllocationSetting.js @@ -127,21 +127,25 @@ export function useRoofAllocationSetting(id) { } }) } else { - roofsArray = [ - { - planNo: planNo, - roofApply: true, - roofSeq: 0, - roofMatlCd: 'ROOF_ID_WA_53A', - roofWidth: 265, - roofHeight: 235, - roofHajebichi: 0, - roofGap: 'HEI_455', - roofLayout: 'P', - roofPitch: 4, - roofAngle: 21.8, - }, - ] + if(roofList.length > 0){ + roofsArray = roofList + }else{ + roofsArray = [ + { + planNo: planNo, + roofApply: true, + roofSeq: 0, + roofMatlCd: 'ROOF_ID_WA_53A', + roofWidth: 265, + roofHeight: 235, + roofHajebichi: 0, + roofGap: 'HEI_455', + roofLayout: 'P', + roofPitch: 4, + roofAngle: 21.8, + }, + ] + } } /** @@ -182,6 +186,9 @@ export function useRoofAllocationSetting(id) { roofSizeSet: '' + res[0].roofSizeSet, roofAngleSet: '' + res[0].roofAngleSet, }) + //데이터 동기화 + setCurrentRoofList(selectRoofs) + }) } catch (error) { console.error('Data fetching error:', error)