Format validation errors as human readable messages
This commit is contained in:
parent
bf2a040cf9
commit
6b82a9ef51
|
@ -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
|
||||
|
|
|
@ -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
|
||||
|
|
Loading…
Reference in New Issue