diff options
author | Lin Jen-Shin <godfat@godfat.org> | 2019-04-19 23:39:12 +0800 |
---|---|---|
committer | Lin Jen-Shin <godfat@godfat.org> | 2019-04-22 17:16:32 +0800 |
commit | a96507bf002f39c7119d91f45c872065a05ad389 (patch) | |
tree | 802be19e15b166f302e62f9a7893cd418a1c6048 /app/controllers/projects | |
parent | 98f898d3cdcc79daad91c538551760295c0123e4 (diff) | |
download | gitlab-ce-a96507bf002f39c7119d91f45c872065a05ad389.tar.gz |
Introduce ServiceResponse to wrap around response
See https://gitlab.com/gitlab-org/gitlab-ce/issues/60730
Diffstat (limited to 'app/controllers/projects')
-rw-r--r-- | app/controllers/projects/branches_controller.rb | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/app/controllers/projects/branches_controller.rb b/app/controllers/projects/branches_controller.rb index e14abbf7c78..fc708400657 100644 --- a/app/controllers/projects/branches_controller.rb +++ b/app/controllers/projects/branches_controller.rb @@ -100,14 +100,14 @@ class Projects::BranchesController < Projects::ApplicationController respond_to do |format| format.html do - flash_type = result[:status] == :error ? :alert : :notice - flash[flash_type] = result[:message] + flash_type = result.error? ? :alert : :notice + flash[flash_type] = result.message redirect_to project_branches_path(@project), status: :see_other end - format.js { head result[:return_code] } - format.json { render json: { message: result[:message] }, status: result[:return_code] } + format.js { head result.http_status } + format.json { render json: { message: result.message }, status: result.http_status } end end |