fix: same contact can be added multiple time
This commit is contained in:
parent
5e60cef6bd
commit
ccb1636efd
@ -606,6 +606,15 @@ function contactOptions(contact) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
async function addContact(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', {
|
let d = await call('crm.fcrm.doctype.crm_deal.crm_deal.add_contact', {
|
||||||
deal: props.dealId,
|
deal: props.dealId,
|
||||||
contact,
|
contact,
|
||||||
|
|||||||
@ -534,6 +534,15 @@ function contactOptions(contact) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
async function addContact(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', {
|
let d = await call('crm.fcrm.doctype.crm_deal.crm_deal.add_contact', {
|
||||||
deal: props.dealId,
|
deal: props.dealId,
|
||||||
contact,
|
contact,
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user