summaryrefslogtreecommitdiff
path: root/lib/api/merge_requests.rb
diff options
context:
space:
mode:
authorDouwe Maan <douwe@gitlab.com>2016-03-21 19:28:48 +0000
committerRémy Coutable <remy@rymai.me>2016-03-22 12:36:02 +0100
commitd0a7dfd66d2c6e078df450de612ca25dc7be52d4 (patch)
treed112c2d6f054f3569200035dab6aba7e2d6cc34a /lib/api/merge_requests.rb
parent4999495705c9ee3c78f04875e4a3251b02b3d433 (diff)
downloadgitlab-ce-d0a7dfd66d2c6e078df450de612ca25dc7be52d4.tar.gz
Merge branch '2489-soft-delete-issues' into 'master'
Soft delete issuables Fixes #2489 What still needs to happen: research on the indexes, the gem suggests a [lot of changes](https://github.com/rubysherpas/paranoia#about-indexes) though this is probably a good idea to discuss and I'm unsure on the impact of an omnibus upgrade as I suspect creating about 10 new indexes has a large impact on the downtime. TODO: - [x] Also group owners can ***soft*** delete - [x] Button should be hidden See merge request !2982
Diffstat (limited to 'lib/api/merge_requests.rb')
-rw-r--r--lib/api/merge_requests.rb12
1 files changed, 12 insertions, 0 deletions
diff --git a/lib/api/merge_requests.rb b/lib/api/merge_requests.rb
index c5e5d57ed4d..93052fba06b 100644
--- a/lib/api/merge_requests.rb
+++ b/lib/api/merge_requests.rb
@@ -100,6 +100,18 @@ module API
end
end
+ # Delete a MR
+ #
+ # Parameters:
+ # id (required) - The ID of the project
+ # merge_request_id (required) - The MR id
+ delete ":id/merge_requests/:merge_request_id" do
+ merge_request = user_project.merge_requests.find_by(id: params[:merge_request_id])
+
+ authorize!(:destroy_merge_request, merge_request)
+ merge_request.destroy
+ end
+
# Routing "merge_request/:merge_request_id/..." is DEPRECATED and WILL BE REMOVED in version 9.0
# Use "merge_requests/:merge_request_id/..." instead.
#