diff --git a/frontend/src/pages/Contact.vue b/frontend/src/pages/Contact.vue index 4c99f730..38be4114 100644 --- a/frontend/src/pages/Contact.vue +++ b/frontend/src/pages/Contact.vue @@ -60,7 +60,10 @@
-
+
{{ contact.data.email_id }}
@@ -93,7 +96,8 @@ size="xs" :label="contact.data.company_name" :image=" - getOrganization(contact.data.company_name)?.organization_logo + getOrganization(contact.data.company_name) + ?.organization_logo " /> {{ contact.data.company_name }} @@ -106,7 +110,9 @@ @@ -563,6 +555,18 @@ async function setPrimaryContact(contact) { } } +function triggerCall() { + let primaryContact = deal.data.contacts.find((c) => c.is_primary) + let contact = primaryContact + ? getContactByName(primaryContact.contact) + : deal.data.contacts[0] + ? getContactByName(deal.data.contacts[0].contact) + : null + primaryContact + ? makeCall(contact.mobile_no) + : errorMessage('No primary contact set') +} + function updateField(name, value, callback) { updateDeal(name, value, () => { deal.data[name] = value diff --git a/frontend/src/stores/organizations.js b/frontend/src/stores/organizations.js index 6de91e69..641fead3 100644 --- a/frontend/src/stores/organizations.js +++ b/frontend/src/stores/organizations.js @@ -1,6 +1,6 @@ import { defineStore } from 'pinia' import { createResource } from 'frappe-ui' -import { reactive, computed } from 'vue' +import { reactive } from 'vue' export const organizationsStore = defineStore('crm-organizations', () => { let organizationsByName = reactive({}) @@ -27,19 +27,8 @@ export const organizationsStore = defineStore('crm-organizations', () => { return organizationsByName[name] } - function getOrganizationOptions() { - return [ - { label: '---', value: '' }, - ...organizations.data?.map((org) => ({ - label: org.name, - value: org.name, - })), - ] - } - return { organizations, - getOrganizationOptions, getOrganization, } })