Skip to content

Commit

Permalink
Fix Fare not properly set in controller (#1291)
Browse files Browse the repository at this point in the history
* Update FareService.php

* Update PirepController.php

Move the logic to controller as requested

* Update FareService.php

Reverting back the service changes as requested

* StyleFix
  • Loading branch information
FatihKoz committed Aug 30, 2021
1 parent b0f52ed commit 57277c5
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions app/Http/Controllers/Admin/PirepController.php
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
use App\Models\Enums\PirepState;
use App\Models\Pirep;
use App\Models\PirepComment;
use App\Models\PirepFare;
use App\Repositories\AircraftRepository;
use App\Repositories\AirlineRepository;
use App\Repositories\AirportRepository;
Expand Down Expand Up @@ -151,10 +152,10 @@ protected function saveFares(Pirep $pirep, Request $request)
$count = $request->input($field_name);
}

$fares[] = [
$fares[] = new PirepFare([
'fare_id' => $fare->id,
'count' => $count,
];
]);
}

$this->fareSvc->saveForPirep($pirep, $fares);
Expand Down

0 comments on commit 57277c5

Please sign in to comment.