fix: add contact/delete contact in deal only reflect on refresh

This commit is contained in:
Shariq Ansari 2023-11-30 13:05:42 +05:30
parent ff9f5fdd91
commit 76b7890ecc

View File

@ -425,13 +425,15 @@ function getParsedFields(sections) {
let contactSection = {
label: 'Contacts',
opened: true,
contacts: deal.data?.contacts.map((contact) => {
return {
name: contact.contact,
is_primary: contact.is_primary,
opened: false,
}
}),
contacts: computed(() =>
deal.data?.contacts.map((contact) => {
return {
name: contact.contact,
is_primary: contact.is_primary,
opened: false,
}
})
),
}
return [...sections, contactSection]
@ -466,7 +468,6 @@ async function addContact(contact) {
contact,
})
if (d) {
await contacts.reload()
deal.reload()
createToast({
title: 'Contact added',
@ -483,7 +484,6 @@ async function removeContact(contact) {
})
if (d) {
deal.reload()
contacts.reload()
createToast({
title: 'Contact removed',
icon: 'check',