From e46abc71cad590c2113247d41feca80d27a557b0 Mon Sep 17 00:00:00 2001 From: Eugen Rochko Date: Wed, 21 Sep 2016 22:07:18 +0200 Subject: Fix notifications in UI, added new API for fetching account relationships --- app/controllers/api/accounts_controller.rb | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'app/controllers/api/accounts_controller.rb') diff --git a/app/controllers/api/accounts_controller.rb b/app/controllers/api/accounts_controller.rb index 1a19ae43e..ccbbc93ff 100644 --- a/app/controllers/api/accounts_controller.rb +++ b/app/controllers/api/accounts_controller.rb @@ -28,6 +28,14 @@ class Api::AccountsController < ApiController render action: :show end + def relationships + ids = params[:id].is_a?(Enumerable) ? params[:id].map { |id| id.to_i } : [params[:id].to_i] + @accounts = Account.find(ids) + @following = Account.following_map(ids, current_user.account_id) + @followed_by = Account.followed_by_map(ids, current_user.account_id) + @blocking = {} + end + private def set_account -- cgit