Skip to content

Commit

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

* Reverse arrays
  • Loading branch information
imorland authored Aug 26, 2021
1 parent 08eeff8 commit e1c82b4
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions src/Content/Tag.php
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,7 @@ public function __invoke(Document $document, Request $request)
$sort = Arr::pull($queryParams, 'sort');
$q = Arr::pull($queryParams, 'q', '');
$page = Arr::pull($queryParams, 'page', 1);
$filters = Arr::pull($queryParams, 'filter', []);

$sortMap = $this->getSortMap();

Expand All @@ -77,6 +78,8 @@ public function __invoke(Document $document, Request $request)
'page' => ['offset' => ($page - 1) * 20, 'limit' => 20]
];

$params['filter'] = array_merge($filters, $params['filter']);

$apiDocument = $this->getApiDocument($request, $params);

$tagsDocument = $this->getTagsDocument($request, $slug);
Expand Down

0 comments on commit e1c82b4

Please sign in to comment.