mirror of
https://github.com/pixelfed/pixelfed.git
synced 2024-12-24 08:44:02 +00:00
Update AccountTransformer
This commit is contained in:
parent
e4669a8aab
commit
530149f0f4
2 changed files with 6 additions and 8 deletions
|
@ -102,19 +102,19 @@ class ApiV1Controller extends Controller
|
|||
abort_if(!$request->user(), 403);
|
||||
$id = $request->user()->id;
|
||||
|
||||
$res = Cache::remember('mastoapi:user:account:id:'.$id, now()->addHours(6), function() use($id) {
|
||||
//$res = Cache::remember('mastoapi:user:account:id:'.$id, now()->addHours(6), function() use($id) {
|
||||
$profile = Profile::whereNull('status')->whereUserId($id)->firstOrFail();
|
||||
$resource = new Fractal\Resource\Item($profile, new AccountTransformer());
|
||||
$res = $this->fractal->createData($resource)->toArray();
|
||||
$res['source'] = [
|
||||
'privacy' => $profile->is_private ? 'private' : 'public',
|
||||
'sensitive' => $profile->cw ? true : false,
|
||||
'language' => 'en',
|
||||
'language' => null,
|
||||
'note' => '',
|
||||
'fields' => []
|
||||
];
|
||||
return $res;
|
||||
});
|
||||
// return $res;
|
||||
// });
|
||||
|
||||
return response()->json($res);
|
||||
}
|
||||
|
|
|
@ -29,12 +29,10 @@ class AccountTransformer extends Fractal\TransformerAbstract
|
|||
'avatar_static' => $profile->avatarUrl(),
|
||||
'header' => '',
|
||||
'header_static' => '',
|
||||
'header_bg' => $profile->header_bg,
|
||||
'emojis' => [],
|
||||
'moved' => null,
|
||||
'fields' => [],
|
||||
'bot' => false,
|
||||
'website' => $profile->website,
|
||||
'fields' => null,
|
||||
'bot' => null,
|
||||
'software' => 'pixelfed',
|
||||
'is_admin' => (bool) $is_admin,
|
||||
];
|
||||
|
|
Loading…
Reference in a new issue