diff --git a/src/components/common/VnCard.vue b/src/components/common/VnCard.vue index c81bcd8e2..17fa74317 100644 --- a/src/components/common/VnCard.vue +++ b/src/components/common/VnCard.vue @@ -39,7 +39,7 @@ const arrayData = useArrayData(props.dataKey, { onBeforeMount(async () => { if (!props.baseUrl) arrayData.store.filter.where = { id: route.params.id }; - await arrayData.fetch({ append: false }); + await arrayData.fetch({ append: false, updateRouter: false }); }); if (props.baseUrl) { diff --git a/src/composables/useArrayData.js b/src/composables/useArrayData.js index 8111bcae4..0fcbbbb48 100644 --- a/src/composables/useArrayData.js +++ b/src/composables/useArrayData.js @@ -85,8 +85,12 @@ export function useArrayData(key = useRoute().meta.moduleName, userOptions) { } Object.assign(filter, store.userFilter, exprFilter); - Object.assign(store.filter, filter); - const params = { filter: store.filter }; + let where; + if (filter?.where || store.filter?.where) + where = Object.assign(filter?.where ?? {}, store.filter?.where ?? {}); + Object.assign(filter, store.filter); + filter.where = where; + const params = { filter }; Object.assign(params, userParams); params.filter.skip = store.skip; @@ -148,7 +152,7 @@ export function useArrayData(key = useRoute().meta.moduleName, userOptions) { } async function addFilter({ filter, params }) { - if (filter) store.userFilter = Object.assign(store.userFilter, filter); + if (filter) store.filter = filter; let userParams = { ...store.userParams, ...params }; userParams = sanitizerParams(userParams, store?.exprBuilder); @@ -161,7 +165,7 @@ export function useArrayData(key = useRoute().meta.moduleName, userOptions) { } async function addFilterWhere(where) { - const storedFilter = { ...store.userFilter }; + const storedFilter = { ...store.filter }; if (!storedFilter?.where) storedFilter.where = {}; where = { ...storedFilter.where, ...where }; await addFilter({ filter: { where } }); diff --git a/src/pages/Travel/Card/TravelDescriptor.vue b/src/pages/Travel/Card/TravelDescriptor.vue index b74761b37..bda29903b 100644 --- a/src/pages/Travel/Card/TravelDescriptor.vue +++ b/src/pages/Travel/Card/TravelDescriptor.vue @@ -65,7 +65,6 @@ const setData = (entity) => (data.value = useCardDescription(entity.ref, entity. :subtitle="data.subtitle" :filter="filter" data-key="travelData" - :summary="$attrs" @on-fetch="setData" >