mirror of
https://github.com/flarum/core.git
synced 2025-08-04 15:37:51 +02:00
Fix Index content, only use search when applicable.
This commit is contained in:
@@ -75,10 +75,14 @@ class Index
|
|||||||
|
|
||||||
$params = [
|
$params = [
|
||||||
'sort' => $sort && isset($sortMap[$sort]) ? $sortMap[$sort] : '',
|
'sort' => $sort && isset($sortMap[$sort]) ? $sortMap[$sort] : '',
|
||||||
'filter' => compact('q'),
|
'filter' => [],
|
||||||
'page' => ['offset' => ($page - 1) * 20, 'limit' => 20]
|
'page' => ['offset' => ($page - 1) * 20, 'limit' => 20]
|
||||||
];
|
];
|
||||||
|
|
||||||
|
if ($q) {
|
||||||
|
$params['filter']['q'] = $q;
|
||||||
|
}
|
||||||
|
|
||||||
$apiDocument = $this->getApiDocument($request->getAttribute('actor'), $params);
|
$apiDocument = $this->getApiDocument($request->getAttribute('actor'), $params);
|
||||||
$defaultRoute = $this->settings->get('default_route');
|
$defaultRoute = $this->settings->get('default_route');
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user