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

Pass validation errors in JSON endpoint

parent 1292c158
......@@ -7,7 +7,7 @@ module Groups
format.json do
return head :ok if @group.update(variables_params)
head :bad_request
render status: :bad_request, json: @group.errors.to_hash
end
end
end
......
......@@ -6,7 +6,7 @@ class Projects::VariablesController < Projects::ApplicationController
format.json do
return head :ok if @project.update(variables_params)
head :bad_request
render status: :bad_request, json: @project.errors.to_hash
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