Chore: Code Cleanup in API controllers (#932)

* Chore: Code Cleanup in API controllers

* Remove unnecessary scoping for accounts controller
This commit is contained in:
Sojan Jose
2020-06-07 13:58:05 +05:30
committed by GitHub
parent 3d84568a37
commit 051871a3cd
35 changed files with 176 additions and 182 deletions

View File

@@ -1,4 +1,4 @@
class Api::V1::Accounts::AgentsController < Api::BaseController
class Api::V1::Accounts::AgentsController < Api::V1::Accounts::BaseController
before_action :fetch_agent, except: [:create, :index]
before_action :check_authorization
before_action :find_user, only: [:create]
@@ -46,7 +46,7 @@ class Api::V1::Accounts::AgentsController < Api::BaseController
def save_account_user
AccountUser.create!(
account_id: current_account.id,
account_id: Current.account.id,
user_id: @user.id,
role: new_agent_params[:role],
inviter_id: current_user.id
@@ -64,6 +64,6 @@ class Api::V1::Accounts::AgentsController < Api::BaseController
end
def agents
@agents ||= current_account.users
@agents ||= Current.account.users
end
end