Improve code style
This commit is contained in:
parent
e4aebad35a
commit
927333f4f8
41 changed files with 126 additions and 122 deletions
|
@ -19,19 +19,19 @@ class Api::V1::AccountsController < ApiController
|
|||
end
|
||||
|
||||
def follow
|
||||
@follow = FollowService.new.(current_user.account, @account.acct)
|
||||
@follow = FollowService.new.call(current_user.account, @account.acct)
|
||||
set_relationship
|
||||
render action: :relationship
|
||||
end
|
||||
|
||||
def unfollow
|
||||
@unfollow = UnfollowService.new.(current_user.account, @account)
|
||||
@unfollow = UnfollowService.new.call(current_user.account, @account)
|
||||
set_relationship
|
||||
render action: :relationship
|
||||
end
|
||||
|
||||
def relationships
|
||||
ids = params[:id].is_a?(Enumerable) ? params[:id].map { |id| id.to_i } : [params[:id].to_i]
|
||||
ids = params[:id].is_a?(Enumerable) ? params[:id].map(&: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)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue