Save user flights
This commit is contained in:
@@ -13,6 +13,7 @@ use App\Models\UserFlight;
|
||||
use Carbon\Carbon;
|
||||
use Illuminate\Http\Request;
|
||||
use Illuminate\Support\Facades\Auth;
|
||||
use Inertia\Inertia;
|
||||
|
||||
class FlightImportController extends Controller
|
||||
{
|
||||
@@ -168,7 +169,7 @@ class FlightImportController extends Controller
|
||||
$validated = $request->validate([
|
||||
'date' => 'required|date',
|
||||
'imported_flight_id' => 'required|exists:imported_flights,id',
|
||||
'flight_number' => 'required|string',
|
||||
'flight_number' => 'nullable|string',
|
||||
'from_id' => 'required|integer|exists:airports,id',
|
||||
'to_id' => 'required|integer|exists:airports,id',
|
||||
'dep_time' => 'nullable|date_format:H:i',
|
||||
@@ -238,15 +239,14 @@ class FlightImportController extends Controller
|
||||
'aircraft_id' => $validated['aircraft_id'] ?? null,
|
||||
'aircraft_registration' => $validated['registration'] ?? null,
|
||||
'seat_number' => $validated['seat_number'] ?? null,
|
||||
'seat_type_id' => $validated['seat_type_id'] ?? null,
|
||||
'flight_class_id' => $validated['flight_class_id'] ?? null,
|
||||
'flight_reason_id' => $validated['flight_reason_id'] ?? null,
|
||||
'seat_type_id' => $validated['seat_type_id'] ?? 0,
|
||||
'flight_class_id' => $validated['flight_class_id'] ?? 0,
|
||||
'flight_reason_id' => $validated['flight_reason_id'] ?? 0,
|
||||
'note' => $validated['note'] ?? null,
|
||||
]);
|
||||
|
||||
ImportedFlight::destroy($validated['imported_flight_id']);
|
||||
|
||||
return redirect()->route('reconcile');
|
||||
return to_route('reconcile');
|
||||
}
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user