summaryrefslogtreecommitdiff
path: root/lib/api/todos.rb
diff options
context:
space:
mode:
authorRobert Schilling <rschilling@student.tugraz.at>2016-12-04 18:11:19 +0100
committerRobert Schilling <rschilling@student.tugraz.at>2016-12-04 18:11:19 +0100
commit74c8669b0a96b6afcb41ce5e09b147c7309ecbeb (patch)
tree9aafc9d41139a4e63305350ec2bc812a84e3f0a1 /lib/api/todos.rb
parentbd67459131e22273b502eb27d97709827ff42262 (diff)
downloadgitlab-ce-74c8669b0a96b6afcb41ce5e09b147c7309ecbeb.tar.gz
Use the pagination helper in the APIuse-pagination-helper
Diffstat (limited to 'lib/api/todos.rb')
-rw-r--r--lib/api/todos.rb10
1 files changed, 6 insertions, 4 deletions
diff --git a/lib/api/todos.rb b/lib/api/todos.rb
index 832b04a3bb1..ed8f48aa1e3 100644
--- a/lib/api/todos.rb
+++ b/lib/api/todos.rb
@@ -1,6 +1,7 @@
module API
- # Todos API
class Todos < Grape::API
+ include PaginationParams
+
before { authenticate! }
ISSUABLE_TYPES = {
@@ -44,10 +45,11 @@ module API
desc 'Get a todo list' do
success Entities::Todo
end
+ params do
+ use :pagination
+ end
get do
- todos = find_todos
-
- present paginate(todos), with: Entities::Todo, current_user: current_user
+ present paginate(find_todos), with: Entities::Todo, current_user: current_user
end
desc 'Mark a todo as done' do