mirror of
https://github.com/pixelfed/pixelfed.git
synced 2024-11-22 22:41:27 +00:00
Update Api Transformers
This commit is contained in:
parent
a6bf535dbc
commit
2484ed1e6d
4 changed files with 4 additions and 4 deletions
|
@ -24,7 +24,7 @@ class AccountTransformer extends Fractal\TransformerAbstract
|
||||||
'acct' => $acct,
|
'acct' => $acct,
|
||||||
'display_name' => $profile->name,
|
'display_name' => $profile->name,
|
||||||
'locked' => (bool) $profile->is_private,
|
'locked' => (bool) $profile->is_private,
|
||||||
'created_at' => $profile->created_at->toISOString(),
|
'created_at' => $profile->created_at->format('c'),
|
||||||
'followers_count' => $profile->followerCount(),
|
'followers_count' => $profile->followerCount(),
|
||||||
'following_count' => $profile->followingCount(),
|
'following_count' => $profile->followingCount(),
|
||||||
'statuses_count' => (int) $profile->statusCount(),
|
'statuses_count' => (int) $profile->statusCount(),
|
||||||
|
|
|
@ -21,7 +21,7 @@ class NotificationTransformer extends Fractal\TransformerAbstract
|
||||||
return [
|
return [
|
||||||
'id' => (string) $notification->id,
|
'id' => (string) $notification->id,
|
||||||
'type' => $this->replaceTypeVerb($notification->action),
|
'type' => $this->replaceTypeVerb($notification->action),
|
||||||
'created_at' => (string) $notification->created_at->toISOString(),
|
'created_at' => (string) $notification->created_at->format('c'),
|
||||||
];
|
];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -25,7 +25,7 @@ class StatusStatelessTransformer extends Fractal\TransformerAbstract
|
||||||
'in_reply_to_account_id' => $status->in_reply_to_profile_id,
|
'in_reply_to_account_id' => $status->in_reply_to_profile_id,
|
||||||
'reblog' => null,
|
'reblog' => null,
|
||||||
'content' => $status->rendered ?? $status->caption,
|
'content' => $status->rendered ?? $status->caption,
|
||||||
'created_at' => $status->created_at->toISOString(),
|
'created_at' => $status->created_at->format('c'),
|
||||||
'emojis' => [],
|
'emojis' => [],
|
||||||
'reblogs_count' => $status->shares()->count(),
|
'reblogs_count' => $status->shares()->count(),
|
||||||
'favourites_count' => $status->likes()->count(),
|
'favourites_count' => $status->likes()->count(),
|
||||||
|
|
|
@ -23,7 +23,7 @@ class StatusTransformer extends Fractal\TransformerAbstract
|
||||||
'in_reply_to_account_id' => $status->in_reply_to_profile_id,
|
'in_reply_to_account_id' => $status->in_reply_to_profile_id,
|
||||||
'reblog' => null,
|
'reblog' => null,
|
||||||
'content' => $status->rendered ?? $status->caption,
|
'content' => $status->rendered ?? $status->caption,
|
||||||
'created_at' => $status->created_at->toISOString(),
|
'created_at' => $status->created_at->format('c'),
|
||||||
'emojis' => [],
|
'emojis' => [],
|
||||||
'reblogs_count' => $status->reblogs_count != 0 ? $status->reblogs_count: $status->shares()->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(),
|
'favourites_count' => $status->likes_count != 0 ? $status->likes_count: $status->likes()->count(),
|
||||||
|
|
Loading…
Reference in a new issue