fix: router to contacts after deletion
This commit is contained in:
parent
86fb7dbafa
commit
fd7bf74598
@ -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',
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user