feat: refs #6919 replace url id wip
gitea/salix-front/pipeline/pr-dev This commit looks good Details

This commit is contained in:
Jorge Penadés 2024-11-15 10:06:19 +01:00
parent b67489aae8
commit 84f22cfeb8
3 changed files with 7 additions and 3 deletions

View File

@ -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 });
}
});

View File

@ -12,7 +12,7 @@ const routeName = computed(() => route.name);
<template>
<VnCard
data-key="Client"
url="Clients"
:url="`Clients/${$route.params.id}/getCard`"
:descriptor="CustomerDescriptor"
:filter-panel="routeName != 'CustomerConsumption' && CustomerFilter"
search-data-key="CustomerList"

View File

@ -47,7 +47,7 @@ const setData = (entity) => (data.value = useCardDescription(entity?.name, entit
:subtitle="data.subtitle"
@on-fetch="setData"
:summary="$props.summary"
data-key="customer"
data-key="Client"
>
<template #menu="{ entity }">
<CustomerDescriptorMenu :customer="entity" />