summaryrefslogtreecommitdiff
path: root/lib/api/todos.rb
diff options
context:
space:
mode:
Diffstat (limited to 'lib/api/todos.rb')
-rw-r--r--lib/api/todos.rb13
1 files changed, 11 insertions, 2 deletions
diff --git a/lib/api/todos.rb b/lib/api/todos.rb
index 4a73e3e0e94..5eae92a251e 100644
--- a/lib/api/todos.rb
+++ b/lib/api/todos.rb
@@ -39,8 +39,17 @@ module API
resource :todos do
helpers do
+ params :todo_filters do
+ optional :action, String, values: Todo::ACTION_NAMES.values.map(&:to_s)
+ optional :author_id, Integer
+ optional :state, String, values: Todo.state_machine.states.map(&:name).map(&:to_s)
+ optional :type, String, values: TodosFinder.todo_types
+ optional :project_id, Integer
+ optional :group_id, Integer
+ end
+
def find_todos
- TodosFinder.new(current_user, params).execute
+ TodosFinder.new(current_user, declared_params(include_missing: false)).execute
end
def issuable_and_awardable?(type)
@@ -72,7 +81,7 @@ module API
success Entities::Todo
end
params do
- use :pagination
+ use :pagination, :todo_filters
end
get do
todos = paginate(find_todos.with_entity_associations)