From 244f1b85cc7129a29b8080f769f3d16f69cfd483 Mon Sep 17 00:00:00 2001 From: Shariq Ansari Date: Fri, 26 Jul 2024 20:57:45 +0530 Subject: [PATCH] fix: contacts not loading in deal on first load --- frontend/src/pages/Deal.vue | 25 +++++++------------------ 1 file changed, 7 insertions(+), 18 deletions(-) diff --git a/frontend/src/pages/Deal.vue b/frontend/src/pages/Deal.vue index af2a8b47..39bf9d56 100644 --- a/frontend/src/pages/Deal.vue +++ b/frontend/src/pages/Deal.vue @@ -174,8 +174,8 @@ {{ __('Loading...') }}
@@ -603,22 +603,11 @@ const deal_contacts = createResource({ params: { name: props.dealId }, cache: ['deal_contacts', props.dealId], auto: true, - onSuccess: (data) => { - let contactSection = fieldsLayout.data?.find( - (section) => section.name == 'contacts_section', - ) - if (!contactSection) return - contactSection.contacts = data.map((contact) => { - return { - name: contact.name, - full_name: contact.full_name, - email: contact.email, - mobile_no: contact.mobile_no, - image: contact.image, - is_primary: contact.is_primary, - opened: false, - } + transform: (data) => { + data.forEach((contact) => { + contact.opened = false }) + return data }, })