summaryrefslogtreecommitdiff
path: root/lib/api
diff options
context:
space:
mode:
authorLin Jen-Shin <godfat@godfat.org>2019-04-19 23:39:12 +0800
committerLin Jen-Shin <godfat@godfat.org>2019-04-22 17:16:32 +0800
commita96507bf002f39c7119d91f45c872065a05ad389 (patch)
tree802be19e15b166f302e62f9a7893cd418a1c6048 /lib/api
parent98f898d3cdcc79daad91c538551760295c0123e4 (diff)
downloadgitlab-ce-a96507bf002f39c7119d91f45c872065a05ad389.tar.gz
Introduce ServiceResponse to wrap around response
See https://gitlab.com/gitlab-org/gitlab-ce/issues/60730
Diffstat (limited to 'lib/api')
-rw-r--r--lib/api/branches.rb4
1 files changed, 2 insertions, 2 deletions
diff --git a/lib/api/branches.rb b/lib/api/branches.rb
index 5c98b0ad56c..65d7f68bbf9 100644
--- a/lib/api/branches.rb
+++ b/lib/api/branches.rb
@@ -162,8 +162,8 @@ module API
result = DeleteBranchService.new(user_project, current_user)
.execute(params[:branch])
- if result[:status] != :success
- render_api_error!(result[:message], result[:return_code])
+ if result.error?
+ render_api_error!(result.message, result.http_status)
end
end
end