Skip to content

Commit

Permalink
Do not load_organizations in before_action
Browse files Browse the repository at this point in the history
  • Loading branch information
x4d3 committed Nov 27, 2017
1 parent 3e25854 commit 666a7cd
Showing 1 changed file with 2 additions and 2 deletions.
Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@
module MnoEnterprise
class Jpi::V1::Admin::Impac::DashboardTemplatesController < Jpi::V1::Admin::BaseResourceController

before_action :load_organizations, except: [:destroy]

# TODO [APIV2]: [:'widgets.kpis', :'kpis.alerts']
DASHBOARD_DEPENDENCIES = [:widgets, :kpis]

Expand Down Expand Up @@ -36,6 +34,7 @@ def create
@dashboard_template.save!
MnoEnterprise::EventLogger.info('dashboard_template_create', current_user.id, 'Dashboard Template Creation', @dashboard_template)
@dashboard_template = @dashboard_template.load_required(*DASHBOARD_DEPENDENCIES)
load_organizations
render 'show'
end

Expand All @@ -45,6 +44,7 @@ def update
dashboard_template.update!(dashboard_template_params)
@dashboard_template = @dashboard_template.load_required(*DASHBOARD_DEPENDENCIES)
MnoEnterprise::EventLogger.info('dashboard_template_update', current_user.id, 'Dashboard Template Update', @dashboard_template)
load_organizations
render 'show'
end

Expand Down

0 comments on commit 666a7cd

Please sign in to comment.