]>
cat aescling's git repositories - mastodon.git/blob - app/controllers/api/v1/accounts_controller.rb
1 class Api
::V1::AccountsController < ApiController
2 before_action
:doorkeeper_authorize!
3 before_action
:set_account, except
: :verify_credentials
10 @account = current_user
.account
15 @following = @account.following
19 @followers = @account.followers
23 @statuses = @account.statuses
.with_includes
.with_counters
.paginate_by_max_id(20, params
[:max_id], params
[:since_id]).to_a
27 @follow = FollowService
.new
.call(current_user
.account
, @account.acct
)
29 render action
: :relationship
33 @unfollow = UnfollowService
.new
.call(current_user
.account
, @account)
35 render action
: :relationship
39 ids
= params
[:id].is_a
?(Enumerable
) ? params
[:id].map(&:to_i) : [params
[:id].to_i
]
40 @accounts = Account
.find(ids
)
41 @following = Account
.following_map(ids
, current_user
.account_id
)
42 @followed_by = Account
.followed_by_map(ids
, current_user
.account_id
)
49 @account = Account
.find(params
[:id])
53 @following = Account
.following_map([@account.id
], current_user
.account_id
)
54 @followed_by = Account
.followed_by_map([@account.id
], current_user
.account_id
)
This page took 0.081177 seconds and 4 git commands to generate.