Skip to content

Commit

Permalink
search by natureza code
Browse files Browse the repository at this point in the history
  • Loading branch information
tomahock committed Dec 18, 2023
1 parent 0844e15 commit b6cbcf1
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions app/Http/Controllers/IncidentController.php
Original file line number Diff line number Diff line change
Expand Up @@ -305,6 +305,9 @@ public function search(IncidentSearchRequest $request): JsonResponse
$before = $request->get('before');
$after = $request->get('after');

$naturezaCode = $request->get('naturezaCode');


if($request->exists('limit')){
$limit = (int)$request->get('limit');
} else {
Expand Down Expand Up @@ -357,6 +360,8 @@ public function search(IncidentSearchRequest $request): JsonResponse
return $query->with(['history', 'statusHistory']);
})->when($isFMA, function ($query, $isFMA){
return $query->isFMA();
})->when($naturezaCode, function ($query, $naturezaCode){
return $query->where('naturezaCode', $naturezaCode);
})
->paginate($limit);

Expand Down

0 comments on commit b6cbcf1

Please sign in to comment.