🐛fix:解决产品价格删除后没有更新表单

main
LiaoYijun 1 month ago
parent e59c96577c
commit 5d9dd76c75

@ -415,16 +415,14 @@ export const useProductsStore = create(
quotationList: newQuotationList quotationList: newQuotationList
}) })
let promiseDelete = Promise.resolve(newQuotationList)
if (isNotEmpty(quotationId)) { if (isNotEmpty(quotationId)) {
const { result, success } = await deleteQuotationAction(quotationId) const { success } = await deleteQuotationAction(quotationId)
if (!success) { if (success) {
promiseDelete = Promise.reject(result) return Promise.resolve(newQuotationList)
} else {
return Promise.reject(newQuotationList)
} }
} }
return promiseDelete
}, },
// side effects // side effects

@ -294,7 +294,11 @@ const ProductInfoQuotation = ({ editable, ...props }) => {
title="请确认" title="请确认"
description="你要删除这条价格吗?" description="你要删除这条价格吗?"
onConfirm={() => { onConfirm={() => {
deleteQuotation(quotation).catch((ex) => { deleteQuotation(quotation)
.then((res) => {
triggerChange(res);
})
.catch((ex) => {
notification.error({ notification.error({
message: "Notification", message: "Notification",
description: ex.message, description: ex.message,

Loading…
Cancel
Save