From 74c8669b0a96b6afcb41ce5e09b147c7309ecbeb Mon Sep 17 00:00:00 2001 From: Robert Schilling Date: Sun, 4 Dec 2016 18:11:19 +0100 Subject: Use the pagination helper in the API --- lib/api/project_snippets.rb | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'lib/api/project_snippets.rb') diff --git a/lib/api/project_snippets.rb b/lib/api/project_snippets.rb index d0ee9c9a5b2..9d8c5b63685 100644 --- a/lib/api/project_snippets.rb +++ b/lib/api/project_snippets.rb @@ -1,6 +1,7 @@ module API - # Projects API class ProjectSnippets < Grape::API + include PaginationParams + before { authenticate! } params do @@ -24,6 +25,9 @@ module API desc 'Get all project snippets' do success Entities::ProjectSnippet end + params do + use :pagination + end get ":id/snippets" do present paginate(snippets_for_current_user), with: Entities::ProjectSnippet end -- cgit v1.2.1