BIG-94: handle estimate converted to invoice.

This commit is contained in:
elforjani13
2021-09-23 13:02:50 +02:00
parent d1cb7eb51b
commit cd70bf1d80
3 changed files with 22 additions and 6 deletions

View File

@@ -46,7 +46,24 @@ function EstimateDeleteAlert({
});
closeDrawer('estimate-detail-drawer');
})
.catch(({ errors }) => {})
.catch(
({
response: {
data: { errors },
},
}) => {
if (
errors.find((e) => e.type === 'SALE_ESTIMATE_CONVERTED_TO_INVOICE')
) {
AppToaster.show({
intent: Intent.DANGER,
message: intl.get(
'estimate.delete.error.estimate_converted_to_invoice',
),
});
}
},
)
.finally(() => {
closeAlert(name);
});