diff options
author | Phil Hughes <me@iamphill.com> | 2017-08-30 16:49:22 +0100 |
---|---|---|
committer | Phil Hughes <me@iamphill.com> | 2017-08-30 16:49:22 +0100 |
commit | 4d2d744ae9a2d4c3bb0f00805c27704b79e00d72 (patch) | |
tree | 839b1c3ab4c09c80f7d643fe69dae8a83c4e4eb4 /lib/api/projects.rb | |
parent | 25a3b7fab905d09f6f064108f457a4e20c8915ff (diff) | |
parent | f7c8434c7100c3c87eb2a75cd5a128e520d8c110 (diff) | |
download | gitlab-ce-enable-new-navigaton-by-default.tar.gz |
Merge branch 'master' into enable-new-navigaton-by-defaultenable-new-navigaton-by-default
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' |