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

main
LiaoYijun 1 month ago
parent e59c96577c
commit 5d9dd76c75

@ -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

@ -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,

Loading…
Cancel
Save