0
0
Fork 0

fix: refs #6480 reactive descriptor

This commit is contained in:
Jorge Penadés 2024-04-19 13:12:14 +02:00
parent 3fb155e697
commit e38b53ca25
2 changed files with 5 additions and 7 deletions

View File

@ -1,6 +1,5 @@
<script setup>
import { onBeforeMount, watch, computed, ref } from 'vue';
import { useRoute } from 'vue-router';
import { useI18n } from 'vue-i18n';
import SkeletonDescriptor from 'components/ui/SkeletonDescriptor.vue';
import { useArrayData } from 'composables/useArrayData';
@ -40,7 +39,6 @@ const $props = defineProps({
const state = useState();
const { t } = useI18n();
const route = useRoute();
const { viewSummary } = useSummaryDialog();
const arrayData = useArrayData($props.dataKey || $props.module, {
url: $props.url,
@ -56,14 +54,12 @@ defineExpose({
});
onBeforeMount(async () => {
await getData();
watch(
() => route.params.id,
async () => await getData()
);
watch($props, async () => await getData());
});
async function getData() {
store.url = $props.url;
store.filter = $props.filter ?? {};
isLoading.value = true;
try {
const { data } = await arrayData.fetch({ append: false, updateRouter: false });

View File

@ -31,7 +31,9 @@ const entityId = computed(() => {
});
const worker = ref();
const filter = { where: { id: route.params.id}};
const filter = computed(() => {
return { where: { id: entityId.value } };
});
const sip = ref(null);