From 530149f0f4892fd0f57f09529058b300f95bbf51 Mon Sep 17 00:00:00 2001 From: Daniel Supernault Date: Thu, 26 Sep 2019 21:53:55 -0600 Subject: [PATCH] Update AccountTransformer --- app/Http/Controllers/Api/ApiV1Controller.php | 8 ++++---- app/Transformer/Api/Mastodon/v1/AccountTransformer.php | 6 ++---- 2 files changed, 6 insertions(+), 8 deletions(-) diff --git a/app/Http/Controllers/Api/ApiV1Controller.php b/app/Http/Controllers/Api/ApiV1Controller.php index f41fc2c19..0c945ee17 100644 --- a/app/Http/Controllers/Api/ApiV1Controller.php +++ b/app/Http/Controllers/Api/ApiV1Controller.php @@ -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); } diff --git a/app/Transformer/Api/Mastodon/v1/AccountTransformer.php b/app/Transformer/Api/Mastodon/v1/AccountTransformer.php index 3c621c357..abcbf3bf8 100644 --- a/app/Transformer/Api/Mastodon/v1/AccountTransformer.php +++ b/app/Transformer/Api/Mastodon/v1/AccountTransformer.php @@ -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, ];