diff options
author | Robert Schilling <rschilling@student.tugraz.at> | 2016-12-04 18:11:19 +0100 |
---|---|---|
committer | Robert Schilling <rschilling@student.tugraz.at> | 2016-12-04 18:11:19 +0100 |
commit | 74c8669b0a96b6afcb41ce5e09b147c7309ecbeb (patch) | |
tree | 9aafc9d41139a4e63305350ec2bc812a84e3f0a1 /lib/api/users.rb | |
parent | bd67459131e22273b502eb27d97709827ff42262 (diff) | |
download | gitlab-ce-74c8669b0a96b6afcb41ce5e09b147c7309ecbeb.tar.gz |
Use the pagination helper in the APIuse-pagination-helper
Diffstat (limited to 'lib/api/users.rb')
-rw-r--r-- | lib/api/users.rb | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/lib/api/users.rb b/lib/api/users.rb index a73650dc361..bc2362aa72e 100644 --- a/lib/api/users.rb +++ b/lib/api/users.rb @@ -1,6 +1,7 @@ module API - # Users API class Users < Grape::API + include PaginationParams + before { authenticate! } resource :users, requirements: { uid: /[0-9]*/, id: /[0-9]*/ } do @@ -33,6 +34,7 @@ module API optional :active, type: Boolean, default: false, desc: 'Filters only active users' optional :external, type: Boolean, default: false, desc: 'Filters only external users' optional :blocked, type: Boolean, default: false, desc: 'Filters only blocked users' + use :pagination end get do unless can?(current_user, :read_users_list, nil) @@ -330,6 +332,7 @@ module API end params do requires :id, type: Integer, desc: 'The ID of the user' + use :pagination end get ':id/events' do user = User.find_by(id: params[:id]) |