Paginate users in users api
This commit is contained in:
parent
771b5c2298
commit
880cb8aa48
2 changed files with 2 additions and 0 deletions
|
@ -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
|
||||||
|
|
|
@ -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
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue