This commit is contained in:
parent
b07f7b0003
commit
313395ef7c
|
@ -116,9 +116,10 @@ onMounted(async () => {
|
||||||
// Podemos enviarle al form la estructura de data inicial sin necesidad de fetchearla
|
// Podemos enviarle al form la estructura de data inicial sin necesidad de fetchearla
|
||||||
state.set($props.model, $props.formInitialData);
|
state.set($props.model, $props.formInitialData);
|
||||||
|
|
||||||
if ($props.autoLoad && !$props.formInitialData && $props.url) await fetch();
|
if (!$props.formInitialData) {
|
||||||
else if (arrayData.store.data && !$props.formInitialData)
|
if ($props.autoLoad && $props.url) await fetch();
|
||||||
updateAndEmit(arrayData.store.data, 'onFetch');
|
else if (arrayData.store.data) updateAndEmit(arrayData.store.data, 'onFetch');
|
||||||
|
}
|
||||||
if ($props.observeFormChanges) {
|
if ($props.observeFormChanges) {
|
||||||
watch(
|
watch(
|
||||||
() => formData.value,
|
() => formData.value,
|
||||||
|
|
|
@ -34,9 +34,9 @@ const cloneTravel = () => {
|
||||||
|
|
||||||
const cloneTravelWithEntries = async () => {
|
const cloneTravelWithEntries = async () => {
|
||||||
try {
|
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');
|
notify('globals.dataSaved', 'positive');
|
||||||
router.push({ name: 'TravelBasicData', params: { id } });
|
router.push({ name: 'TravelBasicData', params: { data } });
|
||||||
} catch (err) {
|
} catch (err) {
|
||||||
console.err('Error cloning travel with entries');
|
console.err('Error cloning travel with entries');
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue