Pass validation errors in JSON endpoint

This commit is contained in:
Matija Čupić 2018-01-25 03:50:38 +01:00
parent 1292c158ce
commit bf2a040cf9
No known key found for this signature in database
GPG key ID: 4BAF84FFACD2E5DE
2 changed files with 2 additions and 2 deletions

View file

@ -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

View file

@ -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