fix: same contact can be added multiple time

This commit is contained in:
Shariq Ansari 2025-02-04 13:11:55 +05:30
parent 5e60cef6bd
commit ccb1636efd
2 changed files with 18 additions and 0 deletions

View File

@ -606,6 +606,15 @@ function contactOptions(contact) {
}
async function addContact(contact) {
if (dealContacts.data?.find((c) => c.name === contact)) {
createToast({
title: __('Contact already added'),
icon: 'x',
iconClasses: 'text-ink-red-3',
})
return
}
let d = await call('crm.fcrm.doctype.crm_deal.crm_deal.add_contact', {
deal: props.dealId,
contact,

View File

@ -534,6 +534,15 @@ function contactOptions(contact) {
}
async function addContact(contact) {
if (dealContacts.data?.find((c) => c.name === contact)) {
createToast({
title: __('Contact already added'),
icon: 'x',
iconClasses: 'text-ink-red-3',
})
return
}
let d = await call('crm.fcrm.doctype.crm_deal.crm_deal.add_contact', {
deal: props.dealId,
contact,