summaryrefslogtreecommitdiff
path: root/lib/api/project_hooks.rb
diff options
context:
space:
mode:
authorRobert Schilling <rschilling@student.tugraz.at>2016-12-04 18:11:19 +0100
committerRobert Schilling <rschilling@student.tugraz.at>2016-12-04 18:11:19 +0100
commit74c8669b0a96b6afcb41ce5e09b147c7309ecbeb (patch)
tree9aafc9d41139a4e63305350ec2bc812a84e3f0a1 /lib/api/project_hooks.rb
parentbd67459131e22273b502eb27d97709827ff42262 (diff)
downloadgitlab-ce-74c8669b0a96b6afcb41ce5e09b147c7309ecbeb.tar.gz
Use the pagination helper in the APIuse-pagination-helper
Diffstat (limited to 'lib/api/project_hooks.rb')
-rw-r--r--lib/api/project_hooks.rb12
1 files changed, 8 insertions, 4 deletions
diff --git a/lib/api/project_hooks.rb b/lib/api/project_hooks.rb
index 2b36ef7c426..dcc0fb7a911 100644
--- a/lib/api/project_hooks.rb
+++ b/lib/api/project_hooks.rb
@@ -1,6 +1,10 @@
module API
- # Projects API
class ProjectHooks < Grape::API
+ include PaginationParams
+
+ before { authenticate! }
+ before { authorize_admin_project }
+
helpers do
params :project_hook_properties do
requires :url, type: String, desc: "The URL to send the request to"
@@ -17,9 +21,6 @@ module API
end
end
- before { authenticate! }
- before { authorize_admin_project }
-
params do
requires :id, type: String, desc: 'The ID of a project'
end
@@ -27,6 +28,9 @@ module API
desc 'Get project hooks' do
success Entities::ProjectHook
end
+ params do
+ use :pagination
+ end
get ":id/hooks" do
hooks = paginate user_project.hooks