Save user flights

This commit is contained in:
2026-04-05 15:06:27 +10:00
parent bf34c20d85
commit 8a1581641b
9 changed files with 305 additions and 64 deletions
+6 -2
View File
@@ -11,6 +11,7 @@ defineOptions({ layout: MainLayout });
const props = defineProps<{
flight: {
imported_flight_id: number,
flight_reasons: { value: number, title: string }[]
flight_classes:{ value: number, title: string }[]
seat_types: { value: number, title: string }[]
@@ -34,6 +35,7 @@ const props = defineProps<{
const flight = props.flight;
const form = useForm({
imported_flight_id: flight.imported_flight_id,
date: flight.date,
flight_number: flight.flight_number,
from: flight.from_options[0] ?? null,
@@ -53,6 +55,7 @@ const form = useForm({
});
const submitForm = useForm({
imported_flight_id: flight.imported_flight_id,
date: '' as string | null,
flight_number: '' as string | null,
from_id: null as number | null,
@@ -71,6 +74,7 @@ const submitForm = useForm({
});
function submit() {
submitForm.imported_flight_id = form.imported_flight_id;
submitForm.date = form.date;
submitForm.flight_number = form.flight_number;
submitForm.from_id = form.from?.value ?? null;
@@ -139,10 +143,10 @@ function submit() {
<!-- Dep time / Arr time / Duration -->
<v-row>
<v-col cols="12" md="4">
<v-text-field v-model="form.dep_time" type="time" label="Departure Time" placeholder="09:30" :error-messages="submitForm.errors.dep_time" />
<v-text-field clearable v-model="form.dep_time" type="time" label="Departure Time" placeholder="09:30" :error-messages="submitForm.errors.dep_time" />
</v-col>
<v-col cols="12" md="4">
<v-text-field v-model="form.arr_time" type="time" label="Arrival Time" placeholder="11:45" :error-messages="submitForm.errors.arr_time" />
<v-text-field clearable v-model="form.arr_time" type="time" label="Arrival Time" placeholder="11:45" :error-messages="submitForm.errors.arr_time" />
</v-col>
<v-col cols="12" md="4">
<v-text-field v-model="form.duration" label="Duration" placeholder="1:23" :error-messages="submitForm.errors.duration" />