diff --git a/src/components/ui/CardDescriptor.vue b/src/components/ui/CardDescriptor.vue index 4a08daaf5..97aa91728 100644 --- a/src/components/ui/CardDescriptor.vue +++ b/src/components/ui/CardDescriptor.vue @@ -41,7 +41,12 @@ const state = useState(); const slots = useSlots(); const { t } = useI18n(); const { viewSummary } = useSummaryDialog(); -const { store } = useArrayData($props.dataKey); +const arrayData = useArrayData($props.dataKey || $props.module, { + url: $props.url, + filter: $props.filter, + skip: 0, +}); +const { store } = arrayData; const entity = computed(() => store.data); const isLoading = ref(false); @@ -49,24 +54,15 @@ defineExpose({ getData, }); onBeforeMount(async () => { - if ($props.url) { - await getData(); - watch( - () => $props.url, - async (newUrl, lastUrl) => { - if (newUrl == lastUrl) return; - await getData(); - } - ); - } + await getData(); + watch( + () => $props.url, + async () => await getData() + ); }); async function getData() { - const arrayData = useArrayData($props.dataKey, { - url: $props.url, - filter: $props.filter, - skip: 0, - }); + store.url = $props.url; isLoading.value = true; try { const { data } = await arrayData.fetch({ append: false, updateRouter: false }); diff --git a/src/components/ui/CardSummary.vue b/src/components/ui/CardSummary.vue index f5f61155c..cdf19d492 100644 --- a/src/components/ui/CardSummary.vue +++ b/src/components/ui/CardSummary.vue @@ -1,11 +1,10 @@