mirror of
https://github.com/flarum/framework.git
synced 2025-01-06 02:23:36 +08:00
Always use default includes when preloading discussion list
Making them explicit causes problems when extensions want to include something by default (e.g. tags)
This commit is contained in:
parent
da1252eb5e
commit
9a41526310
|
@ -32,9 +32,9 @@ class IndexAction extends SerializeCollectionAction
|
||||||
'lastUser' => true,
|
'lastUser' => true,
|
||||||
'startPost' => false,
|
'startPost' => false,
|
||||||
'lastPost' => false,
|
'lastPost' => false,
|
||||||
'relevantPosts' => false,
|
'relevantPosts' => true,
|
||||||
'relevantPosts.discussion' => false,
|
'relevantPosts.discussion' => true,
|
||||||
'relevantPosts.user' => false
|
'relevantPosts.user' => true
|
||||||
];
|
];
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
|
@ -10,8 +10,8 @@ class IndexAction extends ClientAction
|
||||||
* @var array
|
* @var array
|
||||||
*/
|
*/
|
||||||
protected $sortMap = [
|
protected $sortMap = [
|
||||||
'recent' => '-lastTime',
|
'latest' => '-lastTime',
|
||||||
'replies' => '-commentsCount',
|
'top' => '-commentsCount',
|
||||||
'newest' => '-startTime',
|
'newest' => '-startTime',
|
||||||
'oldest' => '+startTime'
|
'oldest' => '+startTime'
|
||||||
];
|
];
|
||||||
|
@ -30,8 +30,7 @@ class IndexAction extends ClientAction
|
||||||
|
|
||||||
$params = [
|
$params = [
|
||||||
'sort' => $sort ? $this->sortMap[$sort] : '',
|
'sort' => $sort ? $this->sortMap[$sort] : '',
|
||||||
'filter' => ['q' => $q],
|
'filter' => ['q' => $q]
|
||||||
'include' => $q ? 'startUser,lastUser,relevantPosts,relevantPosts.discussion,relevantPosts.user' : ''
|
|
||||||
];
|
];
|
||||||
|
|
||||||
// FIXME: make sure this is extensible. Support pagination.
|
// FIXME: make sure this is extensible. Support pagination.
|
||||||
|
|
Loading…
Reference in New Issue
Block a user