diff options
-rw-r--r-- | app/controllers/groups/variables_controller.rb | 14 | ||||
-rw-r--r-- | app/controllers/projects/variables_controller.rb | 14 |
2 files changed, 14 insertions, 14 deletions
diff --git a/app/controllers/groups/variables_controller.rb b/app/controllers/groups/variables_controller.rb index 3e78711dabf..0ebfebd6682 100644 --- a/app/controllers/groups/variables_controller.rb +++ b/app/controllers/groups/variables_controller.rb @@ -11,13 +11,13 @@ module Groups end def update - respond_to do |format| - format.json do - if @group.update(variables_params) - return render status: :ok, json: { variables: GroupVariableSerializer.new.represent(@group.variables) } - end - - render status: :bad_request, json: @group.errors.full_messages + if @group.update(variables_params) + respond_to do |format| + format.json { return render status: :ok, json: { variables: GroupVariableSerializer.new.represent(@group.variables) } } + end + else + respond_to do |format| + format.json { render status: :bad_request, json: @group.errors.full_messages } end end end diff --git a/app/controllers/projects/variables_controller.rb b/app/controllers/projects/variables_controller.rb index 18225218a1b..329e1cdfef0 100644 --- a/app/controllers/projects/variables_controller.rb +++ b/app/controllers/projects/variables_controller.rb @@ -10,13 +10,13 @@ class Projects::VariablesController < Projects::ApplicationController end def update - respond_to do |format| - format.json do - if @project.update(variables_params) - return render status: :ok, json: { variables: VariableSerializer.new.represent(@project.variables) } - end - - render status: :bad_request, json: @project.errors.full_messages + if @project.update(variables_params) + respond_to do |format| + format.json { return render status: :ok, json: { variables: VariableSerializer.new.represent(@project.variables) } } + end + else + respond_to do |format| + format.json { render status: :bad_request, json: @project.errors.full_messages } end end end |