From e8037c7d6950fb330e3b5e3d951274a56a967480 Mon Sep 17 00:00:00 2001 From: Nabeel Shahzad Date: Tue, 31 Mar 2020 23:42:33 -0400 Subject: [PATCH] Return full PIREP when updating --- app/Http/Controllers/Api/PirepController.php | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/app/Http/Controllers/Api/PirepController.php b/app/Http/Controllers/Api/PirepController.php index cd9ff944..14f17747 100644 --- a/app/Http/Controllers/Api/PirepController.php +++ b/app/Http/Controllers/Api/PirepController.php @@ -212,7 +212,7 @@ class PirepController extends Controller event(new PirepPrefiled($pirep)); - return new PirepResource($pirep); + return $this->get($pirep->id); } /** @@ -258,7 +258,7 @@ class PirepController extends Controller event(new PirepUpdated($pirep)); - return new PirepResource($pirep); + return $this->get($pirep->id); } /** @@ -321,7 +321,7 @@ class PirepController extends Controller $this->pirepSvc->submit($pirep); - return new PirepResource($pirep); + return $this->get($pirep->id); } /** @@ -461,7 +461,7 @@ class PirepController extends Controller { $pirep = Pirep::find($id); - return AcarsRouteResource::collection(Acars::where([ + return AcarsRouteResource::collection(Acars::with('pirep')->where([ 'pirep_id' => $id, 'type' => AcarsType::ROUTE, ])->orderBy('order', 'asc')->get());