Rozdeleni editace letu do samostatnych views

This commit is contained in:
Michal Kváček
2024-10-03 22:41:14 +02:00
parent 86e8dbf8e7
commit bffdd96be2
19 changed files with 454 additions and 359 deletions
+10 -11
View File
@@ -32,10 +32,10 @@ const loading = computed(() => [
useAircraftsStore().isQueryRunning, usePointsOfInterestStore().isQueryRunning, useAirportsStore().isQueryRunning
].some(i => i.value))
const router = useRouter();
const $router = useRouter();
const handleSave = (formData) => {
useFlightsStore().create(formData).then((flight) => {
router.push({name: "flightEdit", params: {id: flight.id, step: "copilot"}});
$router.push({name: "flightEdit", params: {id: flight.id, step: "copilot"}});
});
}
</script>
@@ -44,13 +44,12 @@ const handleSave = (formData) => {
<FlightFormSteps :disabled="['copilot', 'track', 'photos', 'notes']"/>
<FlightEditSkeleton step="basic" v-if="loading"/>
<template v-else>
<FlightFormBasic
@save="handleSave"
:is-request-pending="isMutationRunning"
:aircrafts="aircrafts"
:airports="airports"
:locations="pointsOfInterest"
/>
</template>
<FlightFormBasic
v-else
:is-request-pending="isMutationRunning"
:aircrafts="aircrafts"
:airports="airports"
:locations="pointsOfInterest"
@save="handleSave"
/>
</template>