diff options
author | Eugen Rochko <eugen@zeonfederated.com> | 2016-09-21 22:07:18 +0200 |
---|---|---|
committer | Eugen Rochko <eugen@zeonfederated.com> | 2016-09-21 22:07:18 +0200 |
commit | e46abc71cad590c2113247d41feca80d27a557b0 (patch) | |
tree | 7c7947aa82231a1d28fd2240a689ca057550ea1d /app/controllers | |
parent | 4bec613897d8835bb78202c7a36691b654f14967 (diff) |
Fix notifications in UI, added new API for fetching account relationships
Diffstat (limited to 'app/controllers')
-rw-r--r-- | app/controllers/api/accounts_controller.rb | 8 |
1 files changed, 8 insertions, 0 deletions
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 |