Clean up discussion API

This commit is contained in:
Toby Zerner 2015-01-07 17:25:23 +10:30
parent 569b9ab27e
commit c142965483
2 changed files with 2 additions and 6 deletions

View File

@ -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);

View File

@ -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) {