fix: catch error while converting lead to deal

This commit is contained in:
Shariq Ansari 2025-02-21 14:40:43 +05:30
parent 235b1346a4
commit 3ed63ebc47

View File

@ -599,10 +599,15 @@ async function convertToDeal(updated) {
} else { } else {
let deal = await call( let deal = await call(
'crm.fcrm.doctype.crm_lead.crm_lead.convert_to_deal', 'crm.fcrm.doctype.crm_lead.crm_lead.convert_to_deal',
{ { lead: lead.data.name },
lead: lead.data.name, ).catch((err) => {
}, createToast({
) title: __('Error converting to deal'),
text: __(err.messages?.[0]),
icon: 'x',
iconClasses: 'text-ink-red-4',
})
})
if (deal) { if (deal) {
capture('convert_lead_to_deal') capture('convert_lead_to_deal')
if (updated) { if (updated) {