mirror of
https://github.com/flarum/framework.git
synced 2025-01-20 19:05:32 +08:00
Pass filter params to getApiDocument (#3037)
* Pass filter params to getApiDocument * Set filters directly
This commit is contained in:
parent
fa653d96ee
commit
80b804b297
|
@ -68,12 +68,13 @@ class Index
|
|||
$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]
|
||||
];
|
||||
|
||||
|
|
Loading…
Reference in New Issue
Block a user