summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorRémy Coutable <remy@rymai.me>2017-11-27 16:16:20 +0000
committerRémy Coutable <remy@rymai.me>2017-11-27 16:16:20 +0000
commita7f6ab952acc58e7ef9a33fba3fbaaa0918572fe (patch)
tree2275a931efde5ac9fccc60630f4475a137f08fd7 /lib
parent24fadd7c3d0a8f643e9df1c7ae3c1c7e88e8592e (diff)
parent7fb1bb01bd669cc46514ed17b1b8822a1d962970 (diff)
downloadgitlab-ce-a7f6ab952acc58e7ef9a33fba3fbaaa0918572fe.tar.gz
Merge branch '39601-create-issuable-destroy-service' into 'master'
Create issue and merge request destroy services Closes #39601 See merge request gitlab-org/gitlab-ce!15604
Diffstat (limited to 'lib')
-rw-r--r--lib/api/issues.rb4
-rw-r--r--lib/api/merge_requests.rb4
2 files changed, 6 insertions, 2 deletions
diff --git a/lib/api/issues.rb b/lib/api/issues.rb
index 74dfd9f96de..e60e00d7956 100644
--- a/lib/api/issues.rb
+++ b/lib/api/issues.rb
@@ -255,7 +255,9 @@ module API
authorize!(:destroy_issue, issue)
- destroy_conditionally!(issue)
+ destroy_conditionally!(issue) do |issue|
+ Issuable::DestroyService.new(user_project, current_user).execute(issue)
+ end
end
desc 'List merge requests closing issue' do
diff --git a/lib/api/merge_requests.rb b/lib/api/merge_requests.rb
index 5b4642a2f57..d34886fca2e 100644
--- a/lib/api/merge_requests.rb
+++ b/lib/api/merge_requests.rb
@@ -167,7 +167,9 @@ module API
authorize!(:destroy_merge_request, merge_request)
- destroy_conditionally!(merge_request)
+ destroy_conditionally!(merge_request) do |merge_request|
+ Issuable::DestroyService.new(user_project, current_user).execute(merge_request)
+ end
end
params do