diff options
author | Grzegorz Bizon <grzesiek.bizon@gmail.com> | 2016-02-16 09:30:58 +0100 |
---|---|---|
committer | Grzegorz Bizon <grzesiek.bizon@gmail.com> | 2016-02-19 17:24:59 +0100 |
commit | 7d5a182624acd2e48eba2531f7597a93b117c056 (patch) | |
tree | 53e51427e4186204a3e61689b4990a99320c2b2a /lib | |
parent | 08b8f489290c3b0456fcaef3064d1c333717cb6f (diff) | |
download | gitlab-ce-7d5a182624acd2e48eba2531f7597a93b117c056.tar.gz |
Use POST method instead of DELETE when erasing a build
Discussion:
https://gitlab.com/gitlab-org/gitlab-ce/merge_requests/2560#note_3742042
Diffstat (limited to 'lib')
-rw-r--r-- | lib/api/builds.rb | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/lib/api/builds.rb b/lib/api/builds.rb index 5752ef2725b..b265fa148ba 100644 --- a/lib/api/builds.rb +++ b/lib/api/builds.rb @@ -130,15 +130,15 @@ module API # id (required) - the id of a project # build_id (required) - the id of a build # example Request: - # delete /projects/:id/build/:build_id/content - delete ':id/builds/:build_id/content' do + # post /projects/:id/build/:build_id/erase + post ':id/builds/:build_id/erase' do authorize_update_builds! build = get_build(params[:build_id]) return not_found!(build) unless build return forbidden!('Build is not erasable!') unless build.erasable? - build.erase! + build.erase present build, with: Entities::Build, user_can_download_artifacts: can?(current_user, :download_build_artifacts, user_project) end |