diff options
author | Robert Schilling <rschilling@student.tugraz.at> | 2017-01-17 07:45:07 +0300 |
---|---|---|
committer | Robert Schilling <rschilling@student.tugraz.at> | 2017-02-16 17:32:01 +0300 |
commit | 01ea65e0e9ea5e44fa653fb95e7ba8ca1668af98 (patch) | |
tree | b7360600a01fff3a1e47a4d8c4f00b42d81fe836 /lib/api/system_hooks.rb | |
parent | 28d8b8650759d0032bcfd0fd9b4397d139a43984 (diff) |
Paginate all endpoints that return an array
Diffstat (limited to 'lib/api/system_hooks.rb')
-rw-r--r-- | lib/api/system_hooks.rb | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/lib/api/system_hooks.rb b/lib/api/system_hooks.rb index 708ec8cfe70..d038a3fa828 100644 --- a/lib/api/system_hooks.rb +++ b/lib/api/system_hooks.rb @@ -1,6 +1,7 @@ module API - # Hooks API class SystemHooks < Grape::API + include PaginationParams + before do authenticate! authenticated_as_admin! @@ -10,10 +11,11 @@ module API desc 'Get the list of system hooks' do success Entities::Hook end + params do + use :pagination + end get do - hooks = SystemHook.all - - present hooks, with: Entities::Hook + present paginate(SystemHook.all), with: Entities::Hook end desc 'Create a new system hook' do |