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:
authorLuke Duncalfe <lduncalfe@eml.cc>2019-08-14 04:34:42 +0300
committerLuke Duncalfe <lduncalfe@eml.cc>2019-08-15 06:08:34 +0300
commit88746f5311a2624d99c3639daf2760c6715d5670 (patch)
tree098fee08c628771f755521a83ec1374f3c5e6077 /lib
parent7c9fb3c61715acb7cb2bfcbad1a12a5ef66d9bbd (diff)
CE-specific changes to allow design Todos
CE-specific changes for: https://gitlab.com/gitlab-org/gitlab-ee/merge_requests/15129 Co-Authored-By: Alex Kalderimis <akalderimis@gitlab.com> Co-Authored-By: Luke Duncalfe <lduncalfe@eml.cc>
Diffstat (limited to 'lib')
-rw-r--r--lib/api/todos.rb13
1 files changed, 9 insertions, 4 deletions
diff --git a/lib/api/todos.rb b/lib/api/todos.rb
index 7260ecfb5ee..404675bfaec 100644
--- a/lib/api/todos.rb
+++ b/lib/api/todos.rb
@@ -13,6 +13,13 @@ module API
'issues' => ->(iid) { find_project_issue(iid) }
}.freeze
+ helpers do
+ # EE::API::Todos would override this method
+ def find_todos
+ TodosFinder.new(current_user, params).execute
+ end
+ end
+
params do
requires :id, type: String, desc: 'The ID of a project'
end
@@ -41,10 +48,6 @@ module API
resource :todos do
helpers do
- def find_todos
- TodosFinder.new(current_user, params).execute
- end
-
def issuable_and_awardable?(type)
obj_type = Object.const_get(type)
@@ -107,3 +110,5 @@ module API
end
end
end
+
+API::Todos.prepend_if_ee('EE::API::Todos')