mirror of
https://github.com/pixelfed/pixelfed.git
synced 2024-11-22 14:31:26 +00:00
Update BaseApiController, add source to verify_credentials endpoint
This commit is contained in:
parent
a3404a20e1
commit
043b3b51dd
1 changed files with 9 additions and 1 deletions
|
@ -306,7 +306,15 @@ class BaseApiController extends Controller
|
||||||
$res = Cache::remember('user:account:id:'.$id, now()->addHours(6), function() use($id) {
|
$res = Cache::remember('user:account:id:'.$id, now()->addHours(6), function() use($id) {
|
||||||
$profile = Profile::whereNull('status')->whereUserId($id)->firstOrFail();
|
$profile = Profile::whereNull('status')->whereUserId($id)->firstOrFail();
|
||||||
$resource = new Fractal\Resource\Item($profile, new AccountTransformer());
|
$resource = new Fractal\Resource\Item($profile, new AccountTransformer());
|
||||||
return $this->fractal->createData($resource)->toArray();
|
$res = $this->fractal->createData($resource)->toArray();
|
||||||
|
$res['source'] = [
|
||||||
|
'privacy' => $profile->is_private ? 'private' : 'public',
|
||||||
|
'sensitive' => $profile->cw ? true : false,
|
||||||
|
'language' => 'en',
|
||||||
|
'note' => '',
|
||||||
|
'fields' => []
|
||||||
|
];
|
||||||
|
return $res;
|
||||||
});
|
});
|
||||||
|
|
||||||
return response()->json($res);
|
return response()->json($res);
|
||||||
|
|
Loading…
Reference in a new issue