From cdc0480db875c8d27d25456b6f5dc7b11108d852 Mon Sep 17 00:00:00 2001 From: basssy Date: Tue, 19 Nov 2024 11:14:05 +0900 Subject: [PATCH] =?UTF-8?q?=EA=B2=AC=EC=A0=81=EC=84=9C=20=EC=83=81?= =?UTF-8?q?=EC=84=B8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/components/estimate/Estimate.jsx | 8 ++++---- src/hooks/floorPlan/estimate/useEstimateController.js | 5 ++--- 2 files changed, 6 insertions(+), 7 deletions(-) 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}`) } }) }