Chore: Code Cleanup in API controllers (#932)
* Chore: Code Cleanup in API controllers * Remove unnecessary scoping for accounts controller
This commit is contained in:
@@ -1,16 +1,16 @@
|
||||
class Api::V1::Accounts::LabelsController < Api::BaseController
|
||||
class Api::V1::Accounts::LabelsController < Api::V1::Accounts::BaseController
|
||||
before_action :current_account
|
||||
before_action :fetch_label, except: [:index, :create]
|
||||
before_action :check_authorization
|
||||
|
||||
def index
|
||||
@labels = policy_scope(current_account.labels)
|
||||
@labels = policy_scope(Current.account.labels)
|
||||
end
|
||||
|
||||
def show; end
|
||||
|
||||
def create
|
||||
@label = current_account.labels.create!(permitted_params)
|
||||
@label = Current.account.labels.create!(permitted_params)
|
||||
end
|
||||
|
||||
def update
|
||||
@@ -25,7 +25,7 @@ class Api::V1::Accounts::LabelsController < Api::BaseController
|
||||
private
|
||||
|
||||
def fetch_label
|
||||
@label = current_account.labels.find(params[:id])
|
||||
@label = Current.account.labels.find(params[:id])
|
||||
end
|
||||
|
||||
def check_authorization
|
||||
|
||||
Reference in New Issue
Block a user