Skip to content

Commit

Permalink
Job Filter changes
Browse files Browse the repository at this point in the history
  • Loading branch information
joseangelcrn committed Jun 2, 2024
1 parent 416501a commit 408cabd
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions app/Http/Controllers/JobController.php
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ public function search(Request $request)
$title = $request->get('title');
$description = $request->get('description');
$ignoreOwn = $request->get('ignore_own') == "true";
$tags = $request->get('tags');

$perPage = $request->get('perPage', 5);
$currentPage = $request->get('currentPage', 1);
Expand All @@ -40,6 +41,12 @@ public function search(Request $request)
});
}

if ($tags){
$queryJobs = $queryJobs->whereHas('tags',function($q) use ($tags){
return $q->whereIn('name',$tags);
});
}

$paginatedJobs = $queryJobs
->where('active',true)
->paginate($perPage, '*', null, $currentPage);
Expand Down

0 comments on commit 408cabd

Please sign in to comment.