summaryrefslogtreecommitdiff
path: root/app/controllers
diff options
context:
space:
mode:
authorMatija Čupić <matteeyah@gmail.com>2018-02-01 21:38:41 +0100
committerMatija Čupić <matteeyah@gmail.com>2018-02-05 18:58:20 +0100
commitc95c3ffc9e4f1992929899bfc21440b621cc8daf (patch)
treea40f32e73f159720b5d8d0906a7883ee281aede7 /app/controllers
parente2c8a2231bcc00e5993411e4ad6c0c0db7e1a297 (diff)
downloadgitlab-ce-c95c3ffc9e4f1992929899bfc21440b621cc8daf.tar.gz
Switch emphasis from controller format to update
Diffstat (limited to 'app/controllers')
-rw-r--r--app/controllers/groups/variables_controller.rb14
-rw-r--r--app/controllers/projects/variables_controller.rb14
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