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/environments.rb | |
parent | 53714ddf2bcc56659236d87647d8b8e8412592f3 (diff) | |
download | gitlab-ce-77cf855bb995eb8875b41d5683c30bae2d17f2f4.tar.gz |
Define common helper for describe pagination params in api
Diffstat (limited to 'lib/api/environments.rb')
-rw-r--r-- | lib/api/environments.rb | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/lib/api/environments.rb b/lib/api/environments.rb index 00c901937b1..80bbd9bb6e4 100644 --- a/lib/api/environments.rb +++ b/lib/api/environments.rb @@ -1,6 +1,8 @@ module API # Environments RESTfull API endpoints class Environments < Grape::API + include PaginationParams + before { authenticate! } params do @@ -12,8 +14,7 @@ module API success Entities::Environment end params do - optional :page, type: Integer, desc: 'Page number of the current request' - optional :per_page, type: Integer, desc: 'Number of items per page' + use :pagination end get ':id/environments' do authorize! :read_environment, user_project |