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',