diff --git a/app/controllers/groups/variables_controller.rb b/app/controllers/groups/variables_controller.rb index 5fbf532b98e..3a832a7c005 100644 --- a/app/controllers/groups/variables_controller.rb +++ b/app/controllers/groups/variables_controller.rb @@ -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 diff --git a/app/controllers/projects/variables_controller.rb b/app/controllers/projects/variables_controller.rb index 8bee1b97d14..9c0dad393c3 100644 --- a/app/controllers/projects/variables_controller.rb +++ b/app/controllers/projects/variables_controller.rb @@ -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