Update v1 Api StatusTransformer

This commit is contained in:
Daniel Supernault 2020-03-19 21:22:02 -06:00
parent b6f56c2751
commit cdb6385298
No known key found for this signature in database
GPG key ID: 0DEF1C662C9033F7

View file

@ -19,33 +19,34 @@ class StatusTransformer extends Fractal\TransformerAbstract
{
return [
'id' => (string) $status->id,
'uri' => $status->url(),
'url' => $status->url(),
'created_at' => $status->created_at->toJSON(),
'in_reply_to_id' => $status->in_reply_to_id,
'in_reply_to_account_id' => $status->in_reply_to_profile_id,
'reblog' => null,
'content' => $status->rendered ?? $status->caption ?? '',
'created_at' => $status->created_at->toJSON(),
'emojis' => [],
'replies_count' => 0,
'reblogs_count' => $status->reblogs_count ?? 0,
'favourites_count' => $status->likes_count ?? 0,
'reblogged' => null,
'favourited' => null,
'muted' => null,
'sensitive' => (bool) $status->is_nsfw,
'spoiler_text' => $status->cw_summary ?? '',
'visibility' => $status->visibility ?? $status->scope,
'mentions' => [],
'tags' => [],
'card' => null,
'poll' => null,
'language' => 'en',
'uri' => $status->url(),
'url' => $status->url(),
'replies_count' => 0,
'reblogs_count' => $status->reblogs_count ?? 0,
'favourites_count' => $status->likes_count ?? 0,
'favourited' => false,
'reblogged' => false,
'muted' => false,
'bookmarked' => false,
'pinned' => false,
'content' => $status->rendered ?? $status->caption ?? '',
'reblog' => null,
'application' => [
'name' => 'web',
'website' => null
],
'language' => null,
'pinned' => null,
'mentions' => [],
'tags' => [],
'emojis' => [],
'card' => null,
'poll' => null,
];
}