Skip to content

Commit

Permalink
fix: prevent empty query params
Browse files Browse the repository at this point in the history
  • Loading branch information
jackd248 committed Nov 8, 2024
1 parent 38d3524 commit dd4995c
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions Classes/Controller/RecordController.php
Original file line number Diff line number Diff line change
Expand Up @@ -18,10 +18,10 @@ class RecordController extends ActionController
{
public function filterAction(ServerRequestInterface $request): ResponseInterface
{
$search = $request->getQueryParams()['search'];
$status = (int)$request->getQueryParams()['status'];
$assignee = (int)$request->getQueryParams()['assignee'];
$type = $request->getQueryParams()['type'];
$search = array_key_exists('search', $request->getQueryParams()) ? $request->getQueryParams()['search'] : null;
$status = array_key_exists('status', $request->getQueryParams()) ? (int)$request->getQueryParams()['status'] : null;
$assignee = array_key_exists('assignee', $request->getQueryParams()) ? (int)$request->getQueryParams()['assignee'] : null;
$type = array_key_exists('type', $request->getQueryParams()) ? $request->getQueryParams()['type'] : null;

$records = ContentUtility::getRecordsByFilter($search, $status, $assignee, $type);
$result = [];
Expand Down

0 comments on commit dd4995c

Please sign in to comment.