diff options
author | Semyon Pupkov <mail@semyonpupkov.com> | 2016-11-22 00:15:46 +0500 |
---|---|---|
committer | Semyon Pupkov <mail@semyonpupkov.com> | 2016-11-22 09:19:26 +0500 |
commit | 77cf855bb995eb8875b41d5683c30bae2d17f2f4 (patch) | |
tree | ca476011924646484be55130438ea7e3295b60ab /lib/api/commits.rb | |
parent | 53714ddf2bcc56659236d87647d8b8e8412592f3 (diff) | |
download | gitlab-ce-77cf855bb995eb8875b41d5683c30bae2d17f2f4.tar.gz |
Define common helper for describe pagination params in api
Diffstat (limited to 'lib/api/commits.rb')
-rw-r--r-- | lib/api/commits.rb | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/lib/api/commits.rb b/lib/api/commits.rb index f412e1da1bf..0319d076ecb 100644 --- a/lib/api/commits.rb +++ b/lib/api/commits.rb @@ -3,6 +3,8 @@ require 'mime/types' module API # Projects commits API class Commits < Grape::API + include PaginationParams + before { authenticate! } before { authorize! :download_code, user_project } @@ -107,9 +109,8 @@ module API failure [[404, 'Not Found']] end params do + use :pagination requires :sha, type: String, desc: 'A commit sha, or the name of a branch or tag' - optional :per_page, type: Integer, desc: 'The amount of items per page for paginaion' - optional :page, type: Integer, desc: 'The page number for pagination' end get ':id/repository/commits/:sha/comments' do commit = user_project.commit(params[:sha]) |