Paginate users in users api

This commit is contained in:
Dmitriy Zaporozhets 2013-04-16 09:26:01 +03:00
parent 771b5c2298
commit 880cb8aa48
2 changed files with 2 additions and 0 deletions

View file

@ -1,6 +1,7 @@
## List users ## List users
Get a list of users. Get a list of users.
This function takes pagination parameters `page` and `per_page` to restrict the list of users.
``` ```
GET /users GET /users

View file

@ -12,6 +12,7 @@ module Gitlab
@users = User.scoped @users = User.scoped
@users = @users.active if params[:active].present? @users = @users.active if params[:active].present?
@users = @users.search(params[:search]) if params[:search].present? @users = @users.search(params[:search]) if params[:search].present?
@users = paginate @users
present @users, with: Entities::User present @users, with: Entities::User
end end