Added Notifications
This commit is contained in:
@@ -154,10 +154,9 @@ class FlightImportController extends Controller
|
||||
'duration' => $this->formatTime($flightToReconcile->duration),
|
||||
'registration' => $flightToReconcile->registration ?? '',
|
||||
'note' => $flightToReconcile->note ?? '',
|
||||
'seat_number' => $flightToReconcile->seat_number ?? '',
|
||||
'flight_class' => $flightToReconcile->flight_class ?? '',
|
||||
'seat_type' => $flightToReconcile->seat_type ?? '',
|
||||
'flight_reason' => $flightToReconcile->flight_reason ?? '',
|
||||
'flight_class' => $flightToReconcile->flight_class !== null ? (int) $flightToReconcile->flight_class : null,
|
||||
'seat_type' => $flightToReconcile->seat_type !== null ? (int) $flightToReconcile->seat_type : null,
|
||||
'flight_reason' => $flightToReconcile->flight_reason !== null ? (int) $flightToReconcile->flight_reason : null,
|
||||
'airline_options' => $this->getPossibleAirlines($flightToReconcile->airline ?? ''),
|
||||
'to_options' => $this->getPossibleAirports($flightToReconcile->to ?? ''),
|
||||
'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,
|
||||
registration: flight.registration,
|
||||
seat_number: flight.seat_number,
|
||||
seat_type: flight.seat_types[flight.seat_type],
|
||||
flight_class: flight.flight_classes[flight.flight_class],
|
||||
flight_reason: flight.flight_reasons[flight.flight_reason],
|
||||
seat_type: flight.seat_types.find(s => s.value === flight.seat_type)?.value ?? null,
|
||||
flight_class: flight.flight_classes.find(c => c.value === flight.flight_class)?.value ?? null,
|
||||
flight_reason: flight.flight_reasons.find(r => r.value === flight.flight_reason)?.value ?? null,
|
||||
note: flight.note,
|
||||
|
||||
});
|
||||
@@ -74,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;
|
||||
@@ -86,14 +87,17 @@ function submit() {
|
||||
submitForm.aircraft_id = form.aircraft?.value ?? null;
|
||||
submitForm.registration = form.registration;
|
||||
submitForm.seat_number = form.seat_number;
|
||||
submitForm.seat_type_id = form.seat_type?.value ?? null;
|
||||
submitForm.flight_class_id = form.flight_class?.value ?? null;
|
||||
submitForm.flight_reason_id = form.flight_reason?.value ?? null;
|
||||
submitForm.seat_type_id = form.seat_type;
|
||||
submitForm.flight_class_id = form.flight_class;
|
||||
submitForm.flight_reason_id = form.flight_reason;
|
||||
submitForm.note = form.note;
|
||||
|
||||
submitForm.post(route('import.save'));
|
||||
}
|
||||
|
||||
import { watch } from 'vue'
|
||||
watch(() => form.flight_reason, (val) => console.log('flight_reason changed:', val))
|
||||
|
||||
</script>
|
||||
|
||||
<template>
|
||||
|
||||
Reference in New Issue
Block a user