Added Notifications
This commit is contained in:
@@ -86,7 +86,7 @@ async function lookupFlight() {
|
||||
}
|
||||
if (data.aircraft_options?.length) {
|
||||
aircraftOptionsData.value = data.aircraft_options
|
||||
if (data.aircraft_options.length === 1 && !form.aircraft) form.aircraft = data.aircraft_options[0]
|
||||
if (!form.aircraft) form.aircraft = data.aircraft_options[0]
|
||||
}
|
||||
|
||||
lookupKey.value++
|
||||
@@ -143,6 +143,18 @@ const submitForm = useForm({
|
||||
auto_update: false,
|
||||
})
|
||||
|
||||
|
||||
const departureIsFuture = computed(() => {
|
||||
if (!form.departure_date) return false
|
||||
return new Date(form.departure_date) > new Date()
|
||||
})
|
||||
|
||||
|
||||
watch(departureIsFuture, (isFuture) => {
|
||||
form.auto_update = isFuture
|
||||
}, { immediate: true })
|
||||
|
||||
|
||||
function submit() {
|
||||
submitForm.flight_number = flightNumber.value
|
||||
submitForm.departure_date = form.departure_date
|
||||
@@ -411,11 +423,11 @@ const arrivalMax = computed(() => {
|
||||
</v-row>
|
||||
|
||||
<!-- ── Auto update ────────────────────────────────────────── -->
|
||||
<v-row>
|
||||
<v-row v-if="departureIsFuture">
|
||||
<v-col cols="12">
|
||||
<v-checkbox
|
||||
v-model="form.auto_update"
|
||||
label="Automatically update aircraft details within 24 hours of flight departure."
|
||||
label="Automatically update flight details within 24 hours of flight departure"
|
||||
:disabled="!lookupComplete"
|
||||
hide-details
|
||||
density="compact"
|
||||
|
||||
Reference in New Issue
Block a user