Skip to content

Commit

Permalink
Return full PIREP when updating
Browse files Browse the repository at this point in the history
  • Loading branch information
nabeelio committed Apr 1, 2020
1 parent 6f05dd6 commit e8037c7
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions app/Http/Controllers/Api/PirepController.php
Original file line number Diff line number Diff line change
Expand Up @@ -212,7 +212,7 @@ public function prefile(PrefileRequest $request)

event(new PirepPrefiled($pirep));

return new PirepResource($pirep);
return $this->get($pirep->id);
}

/**
Expand Down Expand Up @@ -258,7 +258,7 @@ public function update($pirep_id, UpdateRequest $request)

event(new PirepUpdated($pirep));

return new PirepResource($pirep);
return $this->get($pirep->id);
}

/**
Expand Down Expand Up @@ -321,7 +321,7 @@ public function file($pirep_id, FileRequest $request)

$this->pirepSvc->submit($pirep);

return new PirepResource($pirep);
return $this->get($pirep->id);
}

/**
Expand Down Expand Up @@ -461,7 +461,7 @@ public function route_get($id, Request $request)
{
$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());
Expand Down

0 comments on commit e8037c7

Please sign in to comment.