From ba9a49501c7f6d1712a2283805faf6310341d29b Mon Sep 17 00:00:00 2001 From: "hyojun.choi" Date: Wed, 26 Mar 2025 10:59:29 +0900 Subject: [PATCH] =?UTF-8?q?=EC=A7=80=EB=B6=95=EB=A9=B4=20=ED=95=A0?= =?UTF-8?q?=EB=8B=B9=20=3D>=20=EB=A7=88=EC=A7=80=EB=A7=89=EC=9C=BC?= =?UTF-8?q?=EB=A1=9C=20=EC=B6=94=EA=B0=80=EB=90=9C=20=EC=A7=80=EB=B6=95?= =?UTF-8?q?=EC=9E=AC=20=EC=9E=90=EB=8F=99=20=EC=84=A0=ED=83=9D?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../roofcover/useRoofAllocationSetting.js | 24 ++++++++++++------- 1 file changed, 15 insertions(+), 9 deletions(-) diff --git a/src/hooks/roofcover/useRoofAllocationSetting.js b/src/hooks/roofcover/useRoofAllocationSetting.js index 2b9c9494..a8caf5ce 100644 --- a/src/hooks/roofcover/useRoofAllocationSetting.js +++ b/src/hooks/roofcover/useRoofAllocationSetting.js @@ -248,16 +248,22 @@ export function useRoofAllocationSetting(id) { swalFire({ type: 'alert', icon: 'error', text: getMessage('roof.exceed.count') }) return } - setCurrentRoofList([ - ...currentRoofList, - { - ...currentRoofMaterial, + + const originCurrentRoofList = currentRoofList.map((roof) => { + return { + ...roof, selected: false, - id: currentRoofMaterial.roofMatlCd, - name: currentRoofMaterial.roofMatlNm, - index: currentRoofList.length, - }, - ]) + } + }) + originCurrentRoofList.push({ + ...currentRoofMaterial, + selected: true, + id: currentRoofMaterial.roofMatlCd, + name: currentRoofMaterial.roofMatlNm, + index: currentRoofList.length, + }) + + setCurrentRoofList(originCurrentRoofList) } /**