Merge pull request #578 from shariquerik/same-contact

fix: same contact can be added multiple time
This commit is contained in:
Shariq Ansari 2025-02-04 13:13:06 +05:30 committed by GitHub
commit 70804d949f
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
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,