From 313395ef7c59a9afd02438defcae4a9190d5e7c0 Mon Sep 17 00:00:00 2001 From: carlossa Date: Tue, 11 Jun 2024 09:06:09 +0200 Subject: [PATCH] refs #7366 fix travelMigration --- src/components/FormModel.vue | 7 ++++--- src/pages/Travel/Card/TravelDescriptorMenuItems.vue | 4 ++-- 2 files changed, 6 insertions(+), 5 deletions(-) diff --git a/src/components/FormModel.vue b/src/components/FormModel.vue index 4fda3e822..9e934b45f 100644 --- a/src/components/FormModel.vue +++ b/src/components/FormModel.vue @@ -116,9 +116,10 @@ onMounted(async () => { // Podemos enviarle al form la estructura de data inicial sin necesidad de fetchearla state.set($props.model, $props.formInitialData); - if ($props.autoLoad && !$props.formInitialData && $props.url) await fetch(); - else if (arrayData.store.data && !$props.formInitialData) - updateAndEmit(arrayData.store.data, 'onFetch'); + if (!$props.formInitialData) { + if ($props.autoLoad && $props.url) await fetch(); + else if (arrayData.store.data) updateAndEmit(arrayData.store.data, 'onFetch'); + } if ($props.observeFormChanges) { watch( () => formData.value, diff --git a/src/pages/Travel/Card/TravelDescriptorMenuItems.vue b/src/pages/Travel/Card/TravelDescriptorMenuItems.vue index 9309f8686..33becef57 100644 --- a/src/pages/Travel/Card/TravelDescriptorMenuItems.vue +++ b/src/pages/Travel/Card/TravelDescriptorMenuItems.vue @@ -34,9 +34,9 @@ const cloneTravel = () => { const cloneTravelWithEntries = async () => { try { - const { id } = await axios.post(`Travels/${$props.travel.id}/cloneWithEntries`); + const { data } = await axios.post(`Travels/${$props.travel.id}/cloneWithEntries`); notify('globals.dataSaved', 'positive'); - router.push({ name: 'TravelBasicData', params: { id } }); + router.push({ name: 'TravelBasicData', params: { data } }); } catch (err) { console.err('Error cloning travel with entries'); }