Welcome to mirror list, hosted at ThFree Co, Russian Federation.

gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRobert Schilling <rschilling@student.tugraz.at>2017-01-17 07:45:07 +0300
committerRobert Schilling <rschilling@student.tugraz.at>2017-02-16 17:32:01 +0300
commit01ea65e0e9ea5e44fa653fb95e7ba8ca1668af98 (patch)
treeb7360600a01fff3a1e47a4d8c4f00b42d81fe836 /lib/api/deploy_keys.rb
parent28d8b8650759d0032bcfd0fd9b4397d139a43984 (diff)
Paginate all endpoints that return an array
Diffstat (limited to 'lib/api/deploy_keys.rb')
-rw-r--r--lib/api/deploy_keys.rb14
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