Updated scheduled tasks

This commit is contained in:
2026-07-03 15:42:41 +10:00
parent f422a6e38e
commit 16184d9c83
4 changed files with 31 additions and 8 deletions
@@ -13,7 +13,7 @@ class UserApiController extends ApiController
{
public function nextFlight(?User $user): JsonResponse
{
$user = $user ?? auth()->user();
$user = $user?->exists ? $user : auth()->user();
if (!$user->id) {
return response()->json(['message' => 'User not found'], 404);
@@ -48,8 +48,8 @@ class UserApiController extends ApiController
'arrivalTime' => $arrival->format('H:i'),
'arrivalDateUtc' => $flight->arrival_date,
'flightNumber' => $flight->flight_number,
'airlineName' => $flight->airline->name,
'aircraftType' => $flight->aircraft->manufacturer_code . ' ' . $flight->aircraft->model_full_name,
'airlineName' => $flight->airline?->name,
'aircraftType' => $flight->aircraft?->manufacturer_code . ' ' . $flight->aircraft?->model_full_name,
'logoUrl' => $flight->airline?->logo_url ?? '',
]);
}