diff options
author | Robert Schilling <rschilling@student.tugraz.at> | 2017-01-17 05:45:07 +0100 |
---|---|---|
committer | Robert Schilling <rschilling@student.tugraz.at> | 2017-02-16 15:32:01 +0100 |
commit | 01ea65e0e9ea5e44fa653fb95e7ba8ca1668af98 (patch) | |
tree | b7360600a01fff3a1e47a4d8c4f00b42d81fe836 /lib/api/deploy_keys.rb | |
parent | 28d8b8650759d0032bcfd0fd9b4397d139a43984 (diff) | |
download | gitlab-ce-01ea65e0e9ea5e44fa653fb95e7ba8ca1668af98.tar.gz |
Paginate all endpoints that return an array
Diffstat (limited to 'lib/api/deploy_keys.rb')
-rw-r--r-- | lib/api/deploy_keys.rb | 14 |
1 files changed, 11 insertions, 3 deletions
diff --git a/lib/api/deploy_keys.rb b/lib/api/deploy_keys.rb index 3f5183d46a2..982645c2f64 100644 --- a/lib/api/deploy_keys.rb +++ b/lib/api/deploy_keys.rb @@ -1,12 +1,17 @@ module API class DeployKeys < Grape::API + include PaginationParams + before { authenticate! } + desc 'Return all deploy keys' + params do + use :pagination + end get "deploy_keys" do authenticated_as_admin! - keys = DeployKey.all - present keys, with: Entities::SSHKey + present paginate(DeployKey.all), with: Entities::SSHKey end params do @@ -18,8 +23,11 @@ module API desc "Get a specific project's deploy keys" do success Entities::SSHKey end + params do + use :pagination + end get ":id/deploy_keys" do - present user_project.deploy_keys, with: Entities::SSHKey + present paginate(user_project.deploy_keys), with: Entities::SSHKey end desc 'Get single deploy key' do |