diff options
author | Douwe Maan <douwe@selenight.nl> | 2017-08-31 09:13:41 +0200 |
---|---|---|
committer | Douwe Maan <douwe@selenight.nl> | 2017-08-31 09:13:41 +0200 |
commit | 7c215dd23dfa942d6b83252403ce326df96ab3ea (patch) | |
tree | 52c2d7bfa1a11beac6bb135c6eb425dd22d2e320 /lib/api/projects.rb | |
parent | a540f55c6e8ff64f7284ec4194f4c16ca711c685 (diff) | |
parent | d6e956d3a89fbb7f1a503f152fe9a4e2ca931d85 (diff) | |
download | gitlab-ce-7c215dd23dfa942d6b83252403ce326df96ab3ea.tar.gz |
Merge branch 'master' into issue-discussions-refactor
Diffstat (limited to 'lib/api/projects.rb')
-rw-r--r-- | lib/api/projects.rb | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/lib/api/projects.rb b/lib/api/projects.rb index 15c3832b032..78d900984ac 100644 --- a/lib/api/projects.rb +++ b/lib/api/projects.rb @@ -1,7 +1,6 @@ require_dependency 'declarative_policy' module API - # Projects API class Projects < Grape::API include PaginationParams @@ -334,7 +333,10 @@ module API desc 'Remove a project' delete ":id" do authorize! :remove_project, user_project - ::Projects::DestroyService.new(user_project, current_user, {}).async_execute + + destroy_conditionally!(user_project) do + ::Projects::DestroyService.new(user_project, current_user, {}).async_execute + end accepted! end @@ -363,8 +365,7 @@ module API authorize! :remove_fork_project, user_project if user_project.forked? - status 204 - user_project.forked_project_link.destroy + destroy_conditionally!(user_project.forked_project_link) else not_modified! end @@ -408,8 +409,7 @@ module API link = user_project.project_group_links.find_by(group_id: params[:group_id]) not_found!('Group Link') unless link - status 204 - link.destroy + destroy_conditionally!(link) end desc 'Upload a file' |