7366-travelMigration #430

Merged
carlossa merged 13 commits from 7366-travelMigration into dev 2024-06-18 06:03:42 +00:00
2 changed files with 6 additions and 5 deletions
Showing only changes of commit 313395ef7c - Show all commits

View File

@ -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) {
carlossa marked this conversation as resolved Outdated
Outdated
Review

Simplificar if

Simplificar if
if ($props.autoLoad && $props.url) await fetch();
else if (arrayData.store.data) updateAndEmit(arrayData.store.data, 'onFetch');
}
if ($props.observeFormChanges) {
watch(
() => formData.value,

View File

@ -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`);
carlossa marked this conversation as resolved Outdated
Outdated
Review

Revisar, normalmente se hace: const { data } = ... y de ahi ya el id

Revisar, normalmente se hace: `const { data } = ... ` y de ahi ya el id
notify('globals.dataSaved', 'positive');
router.push({ name: 'TravelBasicData', params: { id } });
router.push({ name: 'TravelBasicData', params: { data } });
carlossa marked this conversation as resolved Outdated
Outdated
Review

data.id

data.id
} catch (err) {
console.err('Error cloning travel with entries');
}