Save user flights
This commit is contained in:
@@ -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" />
|
||||
|
||||
Reference in New Issue
Block a user