mirror of
https://github.com/flarum/core.git
synced 2025-07-21 16:51:34 +02:00
Fix non-comment post content serialization
This commit is contained in:
@@ -56,6 +56,6 @@ class DiscussionBasicSerializer extends BaseSerializer
|
|||||||
|
|
||||||
public function addedPosts()
|
public function addedPosts()
|
||||||
{
|
{
|
||||||
return $this->hasMany('Flarum\Api\Serializers\PostBasicSerializer');
|
return $this->hasMany('Flarum\Api\Serializers\PostSerializer');
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@@ -41,7 +41,7 @@ class PostBasicSerializer extends BaseSerializer
|
|||||||
if ($post->type === 'comment') {
|
if ($post->type === 'comment') {
|
||||||
$attributes['content'] = str_limit($post->content, 200);
|
$attributes['content'] = str_limit($post->content, 200);
|
||||||
} else {
|
} else {
|
||||||
$attributes['content'] = json_encode($post->content);
|
$attributes['content'] = $post->content;
|
||||||
}
|
}
|
||||||
|
|
||||||
return $this->extendAttributes($post, $attributes);
|
return $this->extendAttributes($post, $attributes);
|
||||||
|
Reference in New Issue
Block a user