diff --git a/src/components/common/VnCard.vue b/src/components/common/VnCard.vue index c030cbe32..21e4cfb3e 100644 --- a/src/components/common/VnCard.vue +++ b/src/components/common/VnCard.vue @@ -46,7 +46,11 @@ onBeforeMount(async () => { if (!props.idInWhere) { onBeforeRouteUpdate(async (to, from) => { if (to.params.id !== from.params.id) { - arrayData.store.url = `${props.url}/${to.params.id}`; + const regex = /(\/\d+)/; + arrayData.store.url = !regex.test(props.url) + ? `${props.url}/${to.params.id}` + : props.url.replace(regex, `/${to.params.id}`); + await arrayData.fetch({ append: false, updateRouter: false }); } }); diff --git a/src/pages/Customer/Card/CustomerCard.vue b/src/pages/Customer/Card/CustomerCard.vue index 28da34dda..56cbefa63 100644 --- a/src/pages/Customer/Card/CustomerCard.vue +++ b/src/pages/Customer/Card/CustomerCard.vue @@ -12,7 +12,7 @@ const routeName = computed(() => route.name);