Add removed posts as an API attribute

This commit is contained in:
Toby Zerner 2015-05-02 09:00:22 +09:30
parent 20b8c13383
commit 0582d8e60f

View File

@ -21,6 +21,10 @@ class DiscussionBasicSerializer extends BaseSerializer
'title' => $discussion->title
];
if (count($discussion->removedPosts)) {
$attributes['removedPosts'] = $discussion->removedPosts;
}
return $this->extendAttributes($discussion, $attributes);
}