diff --git a/app/Http/Controllers/Api/ApiV1Controller.php b/app/Http/Controllers/Api/ApiV1Controller.php index b99e75247..bd8ca8c45 100644 --- a/app/Http/Controllers/Api/ApiV1Controller.php +++ b/app/Http/Controllers/Api/ApiV1Controller.php @@ -685,7 +685,6 @@ class ApiV1Controller extends Controller ->whereNull('status') ->findOrFail($id); - RelationshipService::refresh($user->profile_id, $target->id); $private = (bool) $target->is_private; $remote = (bool) $target->domain; @@ -718,6 +717,7 @@ class ApiV1Controller extends Controller (new FollowerController())->sendUndoFollow($user->profile, $target); } + RelationshipService::refresh($user->profile_id, $target->id); Cache::forget('profile:following:'.$target->id); Cache::forget('profile:followers:'.$target->id); Cache::forget('profile:following:'.$user->profile_id); @@ -726,8 +726,7 @@ class ApiV1Controller extends Controller Cache::forget('user:account:id:'.$target->user_id); Cache::forget('user:account:id:'.$user->id); - $resource = new Fractal\Resource\Item($target, new RelationshipTransformer()); - $res = $this->fractal->createData($resource)->toArray(); + $res = RelationshipService::get($user->profile_id, $target->id); return response()->json($res); } diff --git a/public/js/spa.js b/public/js/spa.js index df034dbce..2eeaa2263 100644 Binary files a/public/js/spa.js and b/public/js/spa.js differ diff --git a/public/mix-manifest.json b/public/mix-manifest.json index a89ec71c2..7cf967ddc 100644 Binary files a/public/mix-manifest.json and b/public/mix-manifest.json differ