diff --git a/src/components/estimate/Estimate.jsx b/src/components/estimate/Estimate.jsx index 6373a5f7..dba23f5f 100644 --- a/src/components/estimate/Estimate.jsx +++ b/src/components/estimate/Estimate.jsx @@ -234,12 +234,12 @@ export default function Estimate({ params }) { } //Pricing 버튼 - const handlePricing = async (priceCd) => { + const handlePricing = async (showPriceCd) => { const param = { saleStoreId: session.storeId, sapSalesStoreCd: session.custCd, docTpCd: state.estimateType, - priceCd: priceCd, + priceCd: showPriceCd, //itemIdList: state.itemList, //아이템 최초정보로 호출 delFlg 0인거만.. itemIdList: state.itemList.filter((item) => item.delFlg === '0'), } @@ -283,7 +283,7 @@ export default function Estimate({ params }) { }) setState({ - priceCd: priceCd, + priceCd: showPriceCd, itemList: updateList, }) @@ -1030,7 +1030,7 @@ export default function Estimate({ params }) { type="button" className="btn-origin grey ml5" onClick={() => { - handlePricing(state?.priceCd) + handlePricing(showPriceCd) }} > {getMessage('estimate.detail.showPrice.pricingBtn')} diff --git a/src/hooks/floorPlan/estimate/useEstimateController.js b/src/hooks/floorPlan/estimate/useEstimateController.js index 88e3efab..f99ba2eb 100644 --- a/src/hooks/floorPlan/estimate/useEstimateController.js +++ b/src/hooks/floorPlan/estimate/useEstimateController.js @@ -49,7 +49,7 @@ export const useEstimateController = (planNo) => { const [state, setState] = useReducer(reducer, defaultEstimateData) useEffect(() => { - if (!isLoading) { + if (planNo && !isLoading) { if (objectRecoil.floorPlanObjectNo && planNo) { fetchSetting() } @@ -188,15 +188,14 @@ export const useEstimateController = (planNo) => { // console.log('최종 남은 아이템정보:::', estimateData.itemList) console.log('최종 정보::;', estimateData) - //drawingFlg null ???? //2. 상세데이터 저장 // return await promisePost({ url: `${ESTIMATE_API_ENDPOINT}/save-estimate`, data: estimateData }).then((res) => { console.log('res::::::::::::', res) if (res.status === 201) { - console.log('201:::::::::') alert(getMessage('estimate.detail.save.alertMsg')) //어디로 보낼지 + router.push(`/floor-plan/estimate/5/${estimateData.planNo}`) } }) }