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}