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 { contactsStore } from '@/stores/contacts.js'
|
||||||
import { organizationsStore } from '@/stores/organizations.js'
|
import { organizationsStore } from '@/stores/organizations.js'
|
||||||
import { ref, computed, h } from 'vue'
|
import { ref, computed, h } from 'vue'
|
||||||
|
import { useRouter } from 'vue-router'
|
||||||
|
|
||||||
const { getContactByName, contacts } = contactsStore()
|
const { getContactByName, contacts } = contactsStore()
|
||||||
const { getUser } = usersStore()
|
const { getUser } = usersStore()
|
||||||
@ -224,6 +225,8 @@ const props = defineProps({
|
|||||||
},
|
},
|
||||||
})
|
})
|
||||||
|
|
||||||
|
const router = useRouter()
|
||||||
|
|
||||||
const contact = computed(() => getContactByName(props.contactId))
|
const contact = computed(() => getContactByName(props.contactId))
|
||||||
|
|
||||||
const breadcrumbs = computed(() => {
|
const breadcrumbs = computed(() => {
|
||||||
@ -268,6 +271,7 @@ async function deleteContact() {
|
|||||||
})
|
})
|
||||||
contacts.reload()
|
contacts.reload()
|
||||||
close()
|
close()
|
||||||
|
router.push({ name: 'Contacts' })
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
],
|
],
|
||||||
@ -305,7 +309,7 @@ const leads = createListResource({
|
|||||||
'modified',
|
'modified',
|
||||||
],
|
],
|
||||||
filters: {
|
filters: {
|
||||||
email: contact.value.email_id,
|
email: contact.value?.email_id,
|
||||||
converted: 0,
|
converted: 0,
|
||||||
},
|
},
|
||||||
orderBy: 'modified desc',
|
orderBy: 'modified desc',
|
||||||
@ -328,7 +332,7 @@ const deals = createListResource({
|
|||||||
'modified',
|
'modified',
|
||||||
],
|
],
|
||||||
filters: {
|
filters: {
|
||||||
email: contact.value.email_id,
|
email: contact.value?.email_id,
|
||||||
converted: 1,
|
converted: 1,
|
||||||
},
|
},
|
||||||
orderBy: 'modified desc',
|
orderBy: 'modified desc',
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user