Add more airlines and fix edit bugs

This commit is contained in:
2026-04-18 14:22:51 +10:00
parent 147bf43f09
commit 63d6fb9e76
8 changed files with 106 additions and 30 deletions
+4 -4
View File
@@ -137,12 +137,12 @@ class FlightController extends Controller
'flight_class' => $flight->flightClass->toArray(),
'flight_reason' => $flight->flightReason->toArray(),
'airline_options' => $flight->airline
? [['value' => $flight->airline->id, 'title' => $flight->airline->name]]
? [['value' => $flight->airline->id, 'title' => $flight->airline->displayName()]]
: [],
'from_options' => [['value' => $flight->departureAirport->id, 'title' => $flight->departureAirport->name, 'country_code' => strtolower($flight->departureAirport->region->country->code)]],
'to_options' => [['value' => $flight->arrivalAirport->id, 'title' => $flight->arrivalAirport->name, 'country_code' => strtolower($flight->arrivalAirport->region->country->code)]],
'from_options' => [['value' => $flight->departureAirport->id, 'title' => $flight->departureAirport->displayName(), 'country_code' => strtolower($flight->departureAirport->region->country->code)]],
'to_options' => [['value' => $flight->arrivalAirport->id, 'title' => $flight->arrivalAirport->displayName(), 'country_code' => strtolower($flight->arrivalAirport->region->country->code)]],
'aircraft_options' => $flight->aircraft
? [['value' => $flight->aircraft->id, 'title' => $flight->aircraft->name]]
? [['value' => $flight->aircraft->id, 'title' => $flight->aircraft->displayName()]]
: [],
];
return Inertia::render('AddFlight', [