From fd7bf74598b1c847c9d9bc93095ffd6de3f84871 Mon Sep 17 00:00:00 2001 From: Shariq Ansari Date: Thu, 9 Nov 2023 14:31:42 +0530 Subject: [PATCH] fix: router to contacts after deletion --- frontend/src/pages/Contact.vue | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/frontend/src/pages/Contact.vue b/frontend/src/pages/Contact.vue index 138ea6f3..b64589f5 100644 --- a/frontend/src/pages/Contact.vue +++ b/frontend/src/pages/Contact.vue @@ -212,6 +212,7 @@ import { usersStore } from '@/stores/users.js' import { contactsStore } from '@/stores/contacts.js' import { organizationsStore } from '@/stores/organizations.js' import { ref, computed, h } from 'vue' +import { useRouter } from 'vue-router' const { getContactByName, contacts } = contactsStore() const { getUser } = usersStore() @@ -224,6 +225,8 @@ const props = defineProps({ }, }) +const router = useRouter() + const contact = computed(() => getContactByName(props.contactId)) const breadcrumbs = computed(() => { @@ -268,6 +271,7 @@ async function deleteContact() { }) contacts.reload() close() + router.push({ name: 'Contacts' }) }, }, ], @@ -305,7 +309,7 @@ const leads = createListResource({ 'modified', ], filters: { - email: contact.value.email_id, + email: contact.value?.email_id, converted: 0, }, orderBy: 'modified desc', @@ -328,7 +332,7 @@ const deals = createListResource({ 'modified', ], filters: { - email: contact.value.email_id, + email: contact.value?.email_id, converted: 1, }, orderBy: 'modified desc',