Commit bb445009 authored by Matija Čupić's avatar Matija Čupić

Switch emphasis from controller format to update

parent 601fba38
...@@ -11,13 +11,13 @@ module Groups ...@@ -11,13 +11,13 @@ module Groups
end end
def update def update
respond_to do |format|
format.json do
if @group.update(variables_params) if @group.update(variables_params)
return render status: :ok, json: { variables: GroupVariableSerializer.new.represent(@group.variables) } respond_to do |format|
format.json { return render status: :ok, json: { variables: GroupVariableSerializer.new.represent(@group.variables) } }
end end
else
render status: :bad_request, json: @group.errors.full_messages respond_to do |format|
format.json { render status: :bad_request, json: @group.errors.full_messages }
end end
end end
end end
......
...@@ -12,13 +12,13 @@ class Projects::VariablesController < Projects::ApplicationController ...@@ -12,13 +12,13 @@ class Projects::VariablesController < Projects::ApplicationController
end end
def update def update
respond_to do |format|
format.json do
if @project.update(variables_params) if @project.update(variables_params)
return render status: :ok, json: { variables: VariableSerializer.new.represent(@project.variables) } respond_to do |format|
format.json { return render status: :ok, json: { variables: VariableSerializer.new.represent(@project.variables) } }
end end
else
render status: :bad_request, json: @project.errors.full_messages respond_to do |format|
format.json { render status: :bad_request, json: @project.errors.full_messages }
end end
end end
end end
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment