hide all cancelled pireps #180

This commit is contained in:
Nabeel Shahzad
2018-02-10 13:25:40 -06:00
parent 3ded06390c
commit 8acb9291fe
3 changed files with 6 additions and 7 deletions

View File

@@ -94,10 +94,7 @@ class PirepController extends Controller
$user = Auth::user();
$where = [['user_id', $user->id]];
if(setting('pireps.hide_cancelled_pireps')) {
$where[] = ['state', '<>', PirepState::CANCELLED];
}
$where[] = ['state', '<>', PirepState::CANCELLED];
$this->pirepRepo->pushCriteria(new WhereCriteria($request, $where));
$pireps = $this->pirepRepo->orderBy('created_at', 'desc')->paginate();