diff --git a/src/stores/Products/Index.js b/src/stores/Products/Index.js index 7f173c6..d66b067 100644 --- a/src/stores/Products/Index.js +++ b/src/stores/Products/Index.js @@ -415,16 +415,14 @@ export const useProductsStore = create( quotationList: newQuotationList }) - let promiseDelete = Promise.resolve(newQuotationList) - if (isNotEmpty(quotationId)) { - const { result, success } = await deleteQuotationAction(quotationId) - if (!success) { - promiseDelete = Promise.reject(result) + const { success } = await deleteQuotationAction(quotationId) + if (success) { + return Promise.resolve(newQuotationList) + } else { + return Promise.reject(newQuotationList) } } - - return promiseDelete }, // side effects diff --git a/src/views/products/Detail/ProductInfoQuotation.jsx b/src/views/products/Detail/ProductInfoQuotation.jsx index 47cd2e0..9e12784 100644 --- a/src/views/products/Detail/ProductInfoQuotation.jsx +++ b/src/views/products/Detail/ProductInfoQuotation.jsx @@ -294,7 +294,11 @@ const ProductInfoQuotation = ({ editable, ...props }) => { title="请确认" description="你要删除这条价格吗?" onConfirm={() => { - deleteQuotation(quotation).catch((ex) => { + deleteQuotation(quotation) + .then((res) => { + triggerChange(res); + }) + .catch((ex) => { notification.error({ message: "Notification", description: ex.message,