From 5c5b2cdce161987bb04dbcdfff08699f9f1600fa Mon Sep 17 00:00:00 2001 From: Shariq Ansari Date: Sat, 15 Mar 2025 14:46:48 +0530 Subject: [PATCH] fix: fetch side panel sections & deal contacts if not already fetched --- frontend/src/pages/Deal.vue | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/frontend/src/pages/Deal.vue b/frontend/src/pages/Deal.vue index 2554e811..b7dd59eb 100644 --- a/frontend/src/pages/Deal.vue +++ b/frontend/src/pages/Deal.vue @@ -564,10 +564,11 @@ const sections = createResource({ url: 'crm.fcrm.doctype.crm_fields_layout.crm_fields_layout.get_sidepanel_sections', cache: ['sidePanelSections', 'CRM Deal'], params: { doctype: 'CRM Deal' }, - auto: true, transform: (data) => getParsedSections(data), }) +if (!sections.data) sections.fetch() + function getParsedSections(_sections) { _sections.forEach((section) => { if (section.name == 'contacts_section') return @@ -670,7 +671,6 @@ const dealContacts = createResource({ url: 'crm.fcrm.doctype.crm_deal.api.get_deal_contacts', params: { name: props.dealId }, cache: ['deal_contacts', props.dealId], - auto: true, transform: (data) => { data.forEach((contact) => { contact.opened = false @@ -679,6 +679,8 @@ const dealContacts = createResource({ }, }) +if (!dealContacts.data) dealContacts.fetch() + function triggerCall() { let primaryContact = dealContacts.data?.find((c) => c.is_primary) let mobile_no = primaryContact.mobile_no || null