Welcome to mirror list, hosted at ThFree Co, Russian Federation.

gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorMichael Kozono <mkozono@gmail.com>2019-02-25 23:43:14 +0300
committerMichael Kozono <mkozono@gmail.com>2019-02-25 23:43:14 +0300
commit9ffdd736f86b053fd02752e7f86f63229aebf602 (patch)
tree4f13e077e7d0b2222585f1beb010cb3962d7cc11 /lib
parente95b88a06d673ff95792d5c7d3934c88051691d9 (diff)
Revert "Merge branch '49449-add-an-api-endpoint-for-bulk-updating-issues-and-mrs' into 'master'"
This reverts commit 7981c0292b07a0138b096fa082341fcb13e9ce2b, reversing changes made to 9202bbd129537a698b986e6295d0c783b5a84815.
Diffstat (limited to 'lib')
-rw-r--r--lib/api/api.rb1
-rw-r--r--lib/api/issuable_bulk_update.rb51
2 files changed, 0 insertions, 52 deletions
diff --git a/lib/api/api.rb b/lib/api/api.rb
index 3bcf5150b43..4dd1b459554 100644
--- a/lib/api/api.rb
+++ b/lib/api/api.rb
@@ -115,7 +115,6 @@ module API
mount ::API::GroupVariables
mount ::API::ImportGithub
mount ::API::Internal
- mount ::API::IssuableBulkUpdate
mount ::API::Issues
mount ::API::JobArtifacts
mount ::API::Jobs
diff --git a/lib/api/issuable_bulk_update.rb b/lib/api/issuable_bulk_update.rb
deleted file mode 100644
index 5ac6c252d96..00000000000
--- a/lib/api/issuable_bulk_update.rb
+++ /dev/null
@@ -1,51 +0,0 @@
-# frozen_string_literal: true
-
-module API
- class IssuableBulkUpdate < Grape::API
- params do
- requires :id, type: String, desc: 'The ID of a project'
- end
- resource :projects, requirements: API::NAMESPACE_OR_PROJECT_REQUIREMENTS do
- %w(issue merge_request).each do |issuable|
- desc "Updates a list of #{issuable.pluralize}" do
- detail 'This feature was introduced in 11.9'
- end
- params do
- requires :issuable_ids, type: Array[Integer], desc: "Array of #{issuable.pluralize} IDs to be updated"
- optional :state_event, type: String, values: %w(reopen close), desc: 'Reopens or closes a resource'
- optional :milestone_id, type: Integer, desc: 'The milestone ID number'
- optional :add_label_ids, type: Array[Integer], desc: 'IDs of labels to be added'
- optional :remove_label_ids, type: Array[Integer], desc: 'IDs of labels to be removed'
- optional :subscription_event, type: String, values: %w(subscribe unsubscribe),
- desc: 'Subscribes or unsubscribes from a resource'
-
- if issuable == 'issue'
- optional :assignee_ids, type: Array[Integer], desc: 'List of assignee IDs'
- at_least_one_of :state_event, :milestone_id, :add_label_ids, :remove_label_ids,
- :subscription_event, :assignee_ids
- else
- optional :assignee_id, type: Integer, desc: 'ID of the assignee'
- at_least_one_of :state_event, :milestone_id, :add_label_ids, :remove_label_ids,
- :subscription_event, :assignee_id
- end
- end
- put ":id/#{issuable.pluralize}/bulk_update" do
- authorize! :"admin_#{issuable}", user_project
-
- update_params = declared_params(include_missing: false)
-
- result = Issuable::BulkUpdateService.new(user_project, current_user, update_params)
- .execute(issuable)
-
- if result[:success]
- status 200
- quantity = result[:count]
- { message: "#{quantity} #{issuable.pluralize(quantity)} updated" }
- else
- render_api_error!('Bulk update failed', 400)
- end
- end
- end
- end
- end
-end