mirror of
https://github.com/pixelfed/pixelfed.git
synced 2024-12-26 01:36:43 +00:00
Update StatusTransformer
This commit is contained in:
parent
1054b025b1
commit
7c6cff3103
1 changed files with 1 additions and 12 deletions
|
@ -11,10 +11,6 @@ use App\Services\StatusHashtagService;
|
||||||
|
|
||||||
class StatusTransformer extends Fractal\TransformerAbstract
|
class StatusTransformer extends Fractal\TransformerAbstract
|
||||||
{
|
{
|
||||||
protected $defaultIncludes = [
|
|
||||||
'mentions',
|
|
||||||
];
|
|
||||||
|
|
||||||
public function transform(Status $status)
|
public function transform(Status $status)
|
||||||
{
|
{
|
||||||
return [
|
return [
|
||||||
|
@ -49,14 +45,7 @@ class StatusTransformer extends Fractal\TransformerAbstract
|
||||||
'poll' => null,
|
'poll' => null,
|
||||||
'media_attachments' => MediaService::get($status->id),
|
'media_attachments' => MediaService::get($status->id),
|
||||||
'account' => ProfileService::get($status->profile_id),
|
'account' => ProfileService::get($status->profile_id),
|
||||||
'tags' => StatusHashtagService::statusTags($status->id)
|
'tags' => StatusHashtagService::statusTags($status->id),
|
||||||
];
|
];
|
||||||
}
|
}
|
||||||
|
|
||||||
public function includeMentions(Status $status)
|
|
||||||
{
|
|
||||||
$mentions = $status->mentions;
|
|
||||||
|
|
||||||
return $this->collection($mentions, new MentionTransformer());
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue