Format validation errors as human readable messages

This commit is contained in:
Matija Čupić 2018-01-25 12:59:52 +01:00
parent bf2a040cf9
commit 6b82a9ef51
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)
render status: :bad_request, json: @group.errors.to_hash
render status: :bad_request, json: @group.errors.full_messages
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)
render status: :bad_request, json: @project.errors.to_hash
render status: :bad_request, json: @project.errors.full_messages
end
end
end