From 579e675a22b9243cc3781af11fcbe90ea636018c Mon Sep 17 00:00:00 2001 From: jgallego Date: Fri, 17 Jan 2025 16:23:07 +0100 Subject: [PATCH] refactor: refs #8381 update travel data handling in TravelThermographs component --- src/pages/Travel/Card/TravelThermographs.vue | 17 +++-------------- 1 file changed, 3 insertions(+), 14 deletions(-) diff --git a/src/pages/Travel/Card/TravelThermographs.vue b/src/pages/Travel/Card/TravelThermographs.vue index 9773313e1..4e95dfa22 100644 --- a/src/pages/Travel/Card/TravelThermographs.vue +++ b/src/pages/Travel/Card/TravelThermographs.vue @@ -19,16 +19,8 @@ const quasar = useQuasar(); const router = useRouter(); const { t } = useI18n(); const { notify } = useNotify(); -const { store: travelStore, fetch: fetchTravel } = useArrayData('SingleTravel', { - url: 'Travels', - limit: 1, - filter: { - fields: ['id', 'agencyModeFk'], - where: { id: route.params.id }, - }, - // Si quisieras guardar en la URL, podrĂ­as usar searchUrl: 'travelSearch' -}); -const travelItem = computed(() => travelStore.data?.[0] ?? null); + +const travel = computed(() => useArrayData('Travel1').store.data); const thermographPaginateRef = ref(); const warehouses = ref([]); @@ -142,7 +134,7 @@ const redirectToThermographForm = (action, id) => { if (action === 'edit' && id) { routeDetails.query = { travelThermographFk: id }; } else if (action === 'create') { - routeDetails.query = { agencyModeFk: travelItem.value?.agencyModeFk }; + routeDetails.query = { agencyModeFk: travel.value?.agencyModeFk }; } router.push(routeDetails); }; @@ -152,9 +144,6 @@ const removeThermograph = async (id) => { await thermographPaginateRef.value.fetch(); notify(t('Thermograph removed'), 'positive'); }; -onMounted(() => { - fetchTravel({}); -});