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

Pass validation errors in JSON endpoint

parent b1afcb9f
......@@ -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
......
......@@ -8,7 +8,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