Added Notifications
This commit is contained in:
@@ -154,10 +154,9 @@ class FlightImportController extends Controller
|
|||||||
'duration' => $this->formatTime($flightToReconcile->duration),
|
'duration' => $this->formatTime($flightToReconcile->duration),
|
||||||
'registration' => $flightToReconcile->registration ?? '',
|
'registration' => $flightToReconcile->registration ?? '',
|
||||||
'note' => $flightToReconcile->note ?? '',
|
'note' => $flightToReconcile->note ?? '',
|
||||||
'seat_number' => $flightToReconcile->seat_number ?? '',
|
'flight_class' => $flightToReconcile->flight_class !== null ? (int) $flightToReconcile->flight_class : null,
|
||||||
'flight_class' => $flightToReconcile->flight_class ?? '',
|
'seat_type' => $flightToReconcile->seat_type !== null ? (int) $flightToReconcile->seat_type : null,
|
||||||
'seat_type' => $flightToReconcile->seat_type ?? '',
|
'flight_reason' => $flightToReconcile->flight_reason !== null ? (int) $flightToReconcile->flight_reason : null,
|
||||||
'flight_reason' => $flightToReconcile->flight_reason ?? '',
|
|
||||||
'airline_options' => $this->getPossibleAirlines($flightToReconcile->airline ?? ''),
|
'airline_options' => $this->getPossibleAirlines($flightToReconcile->airline ?? ''),
|
||||||
'to_options' => $this->getPossibleAirports($flightToReconcile->to ?? ''),
|
'to_options' => $this->getPossibleAirports($flightToReconcile->to ?? ''),
|
||||||
'from_options' => $this->getPossibleAirports($flightToReconcile->from ?? ''),
|
'from_options' => $this->getPossibleAirports($flightToReconcile->from ?? ''),
|
||||||
|
|||||||
@@ -0,0 +1,25 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
use App\Models\FlightReason;
|
||||||
|
use Illuminate\Database\Migrations\Migration;
|
||||||
|
use Illuminate\Database\Schema\Blueprint;
|
||||||
|
use Illuminate\Support\Facades\Schema;
|
||||||
|
|
||||||
|
return new class extends Migration
|
||||||
|
{
|
||||||
|
/**
|
||||||
|
* Run the migrations.
|
||||||
|
*/
|
||||||
|
public function up(): void
|
||||||
|
{
|
||||||
|
FlightReason::where('name', 'Other')->delete();
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Reverse the migrations.
|
||||||
|
*/
|
||||||
|
public function down(): void
|
||||||
|
{
|
||||||
|
//
|
||||||
|
}
|
||||||
|
};
|
||||||
@@ -47,9 +47,9 @@ const form = useForm({
|
|||||||
aircraft: flight.aircraft_options[0] ?? null,
|
aircraft: flight.aircraft_options[0] ?? null,
|
||||||
registration: flight.registration,
|
registration: flight.registration,
|
||||||
seat_number: flight.seat_number,
|
seat_number: flight.seat_number,
|
||||||
seat_type: flight.seat_types[flight.seat_type],
|
seat_type: flight.seat_types.find(s => s.value === flight.seat_type)?.value ?? null,
|
||||||
flight_class: flight.flight_classes[flight.flight_class],
|
flight_class: flight.flight_classes.find(c => c.value === flight.flight_class)?.value ?? null,
|
||||||
flight_reason: flight.flight_reasons[flight.flight_reason],
|
flight_reason: flight.flight_reasons.find(r => r.value === flight.flight_reason)?.value ?? null,
|
||||||
note: flight.note,
|
note: flight.note,
|
||||||
|
|
||||||
});
|
});
|
||||||
@@ -74,6 +74,7 @@ const submitForm = useForm({
|
|||||||
});
|
});
|
||||||
|
|
||||||
function submit() {
|
function submit() {
|
||||||
|
|
||||||
submitForm.imported_flight_id = form.imported_flight_id;
|
submitForm.imported_flight_id = form.imported_flight_id;
|
||||||
submitForm.date = form.date;
|
submitForm.date = form.date;
|
||||||
submitForm.flight_number = form.flight_number;
|
submitForm.flight_number = form.flight_number;
|
||||||
@@ -86,14 +87,17 @@ function submit() {
|
|||||||
submitForm.aircraft_id = form.aircraft?.value ?? null;
|
submitForm.aircraft_id = form.aircraft?.value ?? null;
|
||||||
submitForm.registration = form.registration;
|
submitForm.registration = form.registration;
|
||||||
submitForm.seat_number = form.seat_number;
|
submitForm.seat_number = form.seat_number;
|
||||||
submitForm.seat_type_id = form.seat_type?.value ?? null;
|
submitForm.seat_type_id = form.seat_type;
|
||||||
submitForm.flight_class_id = form.flight_class?.value ?? null;
|
submitForm.flight_class_id = form.flight_class;
|
||||||
submitForm.flight_reason_id = form.flight_reason?.value ?? null;
|
submitForm.flight_reason_id = form.flight_reason;
|
||||||
submitForm.note = form.note;
|
submitForm.note = form.note;
|
||||||
|
|
||||||
submitForm.post(route('import.save'));
|
submitForm.post(route('import.save'));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
import { watch } from 'vue'
|
||||||
|
watch(() => form.flight_reason, (val) => console.log('flight_reason changed:', val))
|
||||||
|
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<template>
|
<template>
|
||||||
|
|||||||
Reference in New Issue
Block a user