From c895a14fc8228320aba4bcb0de3d5d3cd92eda81 Mon Sep 17 00:00:00 2001 From: basssy Date: Tue, 18 Feb 2025 12:35:42 +0900 Subject: [PATCH] =?UTF-8?q?#766=ED=92=88=EB=AA=85=EC=98=A4=EB=A5=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/components/estimate/Estimate.jsx | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/src/components/estimate/Estimate.jsx b/src/components/estimate/Estimate.jsx index 82ee8c72..01c2bb0d 100644 --- a/src/components/estimate/Estimate.jsx +++ b/src/components/estimate/Estimate.jsx @@ -120,7 +120,15 @@ export default function Estimate({}) { const apiUrl = `/api/display-item/item-list?${queryStringFormatter(param)}` post({ url: apiUrl, data: param }).then((res) => { if (res.length > 0) { - setDisplayItemList(res) + let tempList + let updatedRes = [] + if (estimateContextState?.itemList.length > 0) { + tempList = estimateContextState.itemList.filter((item) => !res.some((resItem) => resItem.itemId === item.itemId)) + updatedRes = [...res, ...tempList] + } else { + updatedRes = [...res] + } + setDisplayItemList(updatedRes) } }) //견적특이사항 API호출 @@ -1776,7 +1784,7 @@ export default function Estimate({}) { onChangeDisplayItem(e.itemId, item.dispOrder, index) } }} - defaultInputValue={item.itemName} + // defaultInputValue={item.itemName} getOptionLabel={(x) => x.itemName} getOptionValue={(x) => x.itemId} isClearable={false}