Skip to content

Commit

Permalink
Merge pull request #578 from shariquerik/same-contact
Browse files Browse the repository at this point in the history
fix: same contact can be added multiple time
  • Loading branch information
shariquerik authored Feb 4, 2025
2 parents 5e60cef + ccb1636 commit 70804d9
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 0 deletions.
9 changes: 9 additions & 0 deletions frontend/src/pages/Deal.vue
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down
9 changes: 9 additions & 0 deletions frontend/src/pages/MobileDeal.vue
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down

0 comments on commit 70804d9

Please sign in to comment.