mirror of
https://github.com/flarum/framework.git
synced 2024-11-27 02:53:37 +08:00
Clean up discussion API
This commit is contained in:
parent
569b9ab27e
commit
c142965483
|
@ -37,7 +37,7 @@ class Index extends Base
|
|||
$key = $this->input('key');
|
||||
$start = $this->start();
|
||||
$include = $this->included(['startPost', 'lastPost', 'relevantPosts']);
|
||||
$count = $this->count($include ? 20 : 50, 50);
|
||||
$count = $this->count($include ? 20 : 50, 30);
|
||||
$sort = $this->sort(['', 'lastPost', 'replies', 'created']);
|
||||
|
||||
$relations = array_merge(['startUser', 'lastUser'], $include);
|
||||
|
|
|
@ -33,11 +33,7 @@ class DiscussionSerializer extends DiscussionBasicSerializer
|
|||
'lastTime' => $discussion->last_time ? $discussion->last_time->toRFC3339String() : null,
|
||||
'lastPostNumber' => $discussion->last_post_number,
|
||||
'canEdit' => $discussion->permission('edit'),
|
||||
'canDelete' => $discussion->permission('delete'),
|
||||
|
||||
// temp
|
||||
'sticky' => $discussion->sticky,
|
||||
'category' => $discussion->category
|
||||
'canDelete' => $discussion->permission('delete')
|
||||
];
|
||||
|
||||
if ($state = $discussion->state) {
|
||||
|
|
Loading…
Reference in New Issue
Block a user