about summary refs log tree commit diff
path: root/app/controllers/api/v1/accounts/relationships_controller.rb
diff options
context:
space:
mode:
authorkibigo! <marrus-sh@users.noreply.github.com>2017-07-12 02:03:17 -0700
committerkibigo! <marrus-sh@users.noreply.github.com>2017-07-12 02:03:17 -0700
commit79d898ae0ad8c0e66bd63ec3e0904e9e5e7894e8 (patch)
treeee8d832ed2f11e9afe62daf0e586a86004eb8d98 /app/controllers/api/v1/accounts/relationships_controller.rb
parentbcf7ee48e94cd2e4d2de28e8854e7f0e2b5cad1f (diff)
parent056b5ed72f6d980bceeb49eb249b8365fe8fce66 (diff)
Merge upstream!! #64 <3 <3
Diffstat (limited to 'app/controllers/api/v1/accounts/relationships_controller.rb')
-rw-r--r--app/controllers/api/v1/accounts/relationships_controller.rb11
1 files changed, 5 insertions, 6 deletions
diff --git a/app/controllers/api/v1/accounts/relationships_controller.rb b/app/controllers/api/v1/accounts/relationships_controller.rb
index cb923ab91..a88cf2021 100644
--- a/app/controllers/api/v1/accounts/relationships_controller.rb
+++ b/app/controllers/api/v1/accounts/relationships_controller.rb
@@ -8,16 +8,15 @@ class Api::V1::Accounts::RelationshipsController < Api::BaseController
 
   def index
     @accounts = Account.where(id: account_ids).select('id')
-    @following = Account.following_map(account_ids, current_user.account_id)
-    @followed_by = Account.followed_by_map(account_ids, current_user.account_id)
-    @blocking = Account.blocking_map(account_ids, current_user.account_id)
-    @muting = Account.muting_map(account_ids, current_user.account_id)
-    @requested = Account.requested_map(account_ids, current_user.account_id)
-    @domain_blocking = Account.domain_blocking_map(account_ids, current_user.account_id)
+    render json: @accounts, each_serializer: REST::RelationshipSerializer, relationships: relationships
   end
 
   private
 
+  def relationships
+    AccountRelationshipsPresenter.new(@accounts, current_user.account_id)
+  end
+
   def account_ids
     @_account_ids ||= Array(params[:id]).map(&:to_i)
   end