mirror of
https://github.com/pixelfed/pixelfed.git
synced 2024-12-25 01:05:36 +00:00
Merge pull request #1729 from pixelfed/staging
Update AccountTransformer
This commit is contained in:
commit
db20a76251
2 changed files with 11 additions and 12 deletions
11
CHANGELOG.md
11
CHANGELOG.md
|
@ -1,6 +1,15 @@
|
||||||
# Release Notes
|
# Release Notes
|
||||||
|
|
||||||
## [Unreleased](https://github.com/pixelfed/pixelfed/compare/v0.10.5...dev)
|
## [Unreleased](https://github.com/pixelfed/pixelfed/compare/v0.10.6...dev)
|
||||||
|
|
||||||
|
### Added
|
||||||
|
|
||||||
|
### Fixed
|
||||||
|
|
||||||
|
### Changed
|
||||||
|
|
||||||
|
|
||||||
|
## [v0.10.6 (2019-09-30)](https://github.com/pixelfed/pixelfed/compare/v0.10.5...v0.10.6)
|
||||||
|
|
||||||
### Added
|
### Added
|
||||||
- Added ```/api/v1/accounts/update_credentials``` endpoint [6afd6970](https://github.com/pixelfed/pixelfed/commit/6afd6970)
|
- Added ```/api/v1/accounts/update_credentials``` endpoint [6afd6970](https://github.com/pixelfed/pixelfed/commit/6afd6970)
|
||||||
|
|
|
@ -9,7 +9,7 @@ use League\Fractal;
|
||||||
class AccountTransformer extends Fractal\TransformerAbstract
|
class AccountTransformer extends Fractal\TransformerAbstract
|
||||||
{
|
{
|
||||||
protected $defaultIncludes = [
|
protected $defaultIncludes = [
|
||||||
'relationship',
|
// 'relationship',
|
||||||
];
|
];
|
||||||
|
|
||||||
public function transform(Profile $profile)
|
public function transform(Profile $profile)
|
||||||
|
@ -24,23 +24,13 @@ 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->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(),
|
||||||
'note' => $profile->bio ?? '',
|
'note' => $profile->bio ?? '',
|
||||||
'url' => $profile->url(),
|
'url' => $profile->url(),
|
||||||
'avatar' => $profile->avatarUrl(),
|
'avatar' => $profile->avatarUrl(),
|
||||||
'avatar_static' => $profile->avatarUrl(),
|
|
||||||
'header' => '',
|
|
||||||
'header_static' => '',
|
|
||||||
'header_bg' => $profile->header_bg,
|
|
||||||
'emojis' => [],
|
|
||||||
'moved' => null,
|
|
||||||
'fields' => [],
|
|
||||||
'bot' => false,
|
|
||||||
'website' => $profile->website,
|
'website' => $profile->website,
|
||||||
'software' => 'pixelfed',
|
|
||||||
'is_admin' => (bool) $is_admin,
|
'is_admin' => (bool) $is_admin,
|
||||||
];
|
];
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue