Skip to content

Commit

Permalink
Include full last discussion info
Browse files Browse the repository at this point in the history
  • Loading branch information
tobyzerner committed Dec 4, 2018
1 parent 275d63a commit fd9d02b
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/Api/Serializer/TagSerializer.php
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
namespace Flarum\Tags\Api\Serializer;

use Flarum\Api\Serializer\AbstractSerializer;
use Flarum\Api\Serializer\BasicDiscussionSerializer;
use Flarum\Api\Serializer\DiscussionSerializer;

class TagSerializer extends AbstractSerializer
{
Expand All @@ -39,7 +39,7 @@ protected function getDefaultAttributes($tag)
'defaultSort' => $tag->default_sort,
'isChild' => (bool) $tag->parent_id,
'isHidden' => (bool) $tag->is_hidden,
'lastPostedAt' => $this->formatDate($tag->last_posted_at),
'lastPostedAt' => $this->formatDate($tag->last_posted_at),
'canStartDiscussion' => $this->actor->can('startDiscussion', $tag),
'canAddToDiscussion' => $this->actor->can('addToDiscussion', $tag)
];
Expand All @@ -64,6 +64,6 @@ protected function parent($tag)
*/
protected function lastPostedDiscussion($tag)
{
return $this->hasOne($tag, BasicDiscussionSerializer::class);
return $this->hasOne($tag, DiscussionSerializer::class);
}
}

0 comments on commit fd9d02b

Please sign in to comment.