diff options
author | Sean McGivern <sean@mcgivern.me.uk> | 2017-08-30 09:56:17 +0000 |
---|---|---|
committer | Sean McGivern <sean@mcgivern.me.uk> | 2017-08-30 09:56:17 +0000 |
commit | f11049ab9131b78c14e95bd95b3073c1eaf59392 (patch) | |
tree | 882c763637a02a386486799c39897bd563c7b6aa /lib/api/projects.rb | |
parent | a16854ff462935f1a967f31abfeb242cf26284cc (diff) | |
parent | ee4820a5268d02fb7ed142511d1a194f06629a1e (diff) | |
download | gitlab-ce-f11049ab9131b78c14e95bd95b3073c1eaf59392.tar.gz |
Merge branch 'api-delete-respect-headers' into 'master'
API: Respect the 'If-Unmodified-Since' for delete endpoints
See merge request !9621
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' |