Skip to content

Commit

Permalink
Pass filter params to getApiDocument (#3037)
Browse files Browse the repository at this point in the history
* Pass filter params to getApiDocument

* Set filters directly
  • Loading branch information
imorland authored Aug 26, 2021
1 parent d875e45 commit d2dbe13
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/Forum/Content/Index.php
Original file line number Diff line number Diff line change
Expand Up @@ -68,12 +68,13 @@ public function __invoke(Document $document, Request $request)
$sort = Arr::pull($queryParams, 'sort');
$q = Arr::pull($queryParams, 'q');
$page = max(1, intval(Arr::pull($queryParams, 'page')));
$filters = Arr::pull($queryParams, 'filter', []);

$sortMap = $this->getSortMap();

$params = [
'sort' => $sort && isset($sortMap[$sort]) ? $sortMap[$sort] : '',
'filter' => [],
'filter' => $filters,
'page' => ['offset' => ($page - 1) * 20, 'limit' => 20]
];

Expand Down

0 comments on commit d2dbe13

Please sign in to comment.