From 3f1bb26ee56bd039545ced3a0198533402dd991a Mon Sep 17 00:00:00 2001 From: Nabeel Shahzad Date: Fri, 11 May 2018 13:43:33 -0500 Subject: [PATCH] Fix PIREPs not showing in admin --- app/Database/seeds/sample.yml | 32 +++++++++++-------- .../Controllers/Admin/PirepController.php | 2 +- 2 files changed, 20 insertions(+), 14 deletions(-) diff --git a/app/Database/seeds/sample.yml b/app/Database/seeds/sample.yml index 042fe491..6a0680e6 100644 --- a/app/Database/seeds/sample.yml +++ b/app/Database/seeds/sample.yml @@ -363,19 +363,6 @@ flights: flight_type: J created_at: NOW updated_at: NOW - - id: flightid_2 - airline_id: 1 - flight_number: 6028 - route_code: A - dpt_airport_id: LGRP - arr_airport_id: LGRP - dpt_time: 9AM CST - arr_time: 1030AM CST - flight_time: 30 - flight_type: J - route: PITZZ4 MNURE WLEEE4 - created_at: NOW - updated_at: NOW - id: flightid_3 airline_id: 1 flight_number: 6028 @@ -501,6 +488,25 @@ pireps: block_on_time: null created_at: now updated_at: now + - id: pirepid_4 + user_id: 1 + airline_id: 1 + flight_number: 101 + aircraft_id: 1 + dpt_airport_id: KJFK + arr_airport_id: KAUS + block_off_time: 2018-04-04T12:42:36+00:00 + block_on_time: 2018-04-04T16:42:36+00:00 + flight_time: 180 # 6 hours + state: 0 + status: 0 + source: 1 + flight_type: J + route: KAUS SID TNV J87 IAH J2 LCH J22 MEI J239 ATL J52 AJFEB J14 BYJAC Q60 JAXSN J14 COLIN J61 HUBBS J55 SIE STAR KJFK + notes: just a pilot report + submitted_at: 2018-04-04T16:50:36+00:00 + created_at: 2018-04-04T16:50:36+00:00 + updated_at: 2018-04-04T17:00:36+00:00 pirep_fares: - id: 1 diff --git a/app/Http/Controllers/Admin/PirepController.php b/app/Http/Controllers/Admin/PirepController.php index 633c1aa4..7601d682 100644 --- a/app/Http/Controllers/Admin/PirepController.php +++ b/app/Http/Controllers/Admin/PirepController.php @@ -191,7 +191,7 @@ class PirepController extends Controller $this->pirepRepo->pushCriteria($criterea); $pireps = $this->pirepRepo - ->whereNotInOrder('status', [ + ->whereNotInOrder('state', [ PirepState::CANCELLED, PirepState::DRAFT, PirepState::IN_PROGRESS