Update Api StatusTransformer

This commit is contained in:
Daniel Supernault 2019-06-18 01:01:36 -06:00
parent f98c7caff6
commit 5204aa2c1c
No known key found for this signature in database
GPG key ID: 0DEF1C662C9033F7

View file

@ -27,8 +27,8 @@ class StatusTransformer extends Fractal\TransformerAbstract
'content' => $status->rendered ?? $status->caption,
'created_at' => $status->created_at->format('c'),
'emojis' => [],
'reblogs_count' => $status->shares()->count(),
'favourites_count' => $status->likes()->count(),
'reblogs_count' => $status->reblogs_count != 0 ? $status->reblogs_count: $status->shares()->count(),
'favourites_count' => $status->likes_count != 0 ? $status->likes_count: $status->likes()->count(),
'reblogged' => $status->shared(),
'favourited' => $status->liked(),
'muted' => null,
@ -47,7 +47,7 @@ class StatusTransformer extends Fractal\TransformerAbstract
'comments_disabled' => $status->comments_disabled ? true : false,
'thread' => false,
'replies' => [],
'parent' => $status->parent() ? $this->transform($status->parent()) : [],
'parent' => [],
];
}