summaryrefslogtreecommitdiff
path: root/lib/api
diff options
context:
space:
mode:
authorGitLab Bot <gitlab-bot@gitlab.com>2020-01-24 12:09:01 +0000
committerGitLab Bot <gitlab-bot@gitlab.com>2020-01-24 12:09:01 +0000
commit2c2dd5e36c4ed5f09f488be288882d98f9124d12 (patch)
treead4c478bb1c588387a881b26a7db7c3237b9d4f3 /lib/api
parent2ff184ad761fbfbe25a3d827c8f704349963a8d2 (diff)
downloadgitlab-ce-2c2dd5e36c4ed5f09f488be288882d98f9124d12.tar.gz
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'lib/api')
-rw-r--r--lib/api/groups.rb16
1 files changed, 10 insertions, 6 deletions
diff --git a/lib/api/groups.rb b/lib/api/groups.rb
index 52fa3f8a68e..d375c35e8c0 100644
--- a/lib/api/groups.rb
+++ b/lib/api/groups.rb
@@ -92,6 +92,15 @@ module API
present paginate(groups), options
end
+
+ def delete_group(group)
+ Gitlab::QueryLimiting.whitelist('https://gitlab.com/gitlab-org/gitlab-foss/issues/46285')
+ destroy_conditionally!(group) do |group|
+ ::Groups::DestroyService.new(group, current_user).async_execute
+ end
+
+ accepted!
+ end
end
resource :groups do
@@ -187,12 +196,7 @@ module API
group = find_group!(params[:id])
authorize! :admin_group, group
- Gitlab::QueryLimiting.whitelist('https://gitlab.com/gitlab-org/gitlab-foss/issues/46285')
- destroy_conditionally!(group) do |group|
- ::Groups::DestroyService.new(group, current_user).async_execute
- end
-
- accepted!
+ delete_group(group)
end
desc 'Get a list of projects in this group.' do