forked from verdnatura/salix-front
fix: refs #6480 reactive descriptor
This commit is contained in:
parent
3fb155e697
commit
e38b53ca25
|
@ -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 });
|
||||
|
|
|
@ -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);
|
||||
|
||||
|
|
Loading…
Reference in New Issue