summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com>2013-04-16 09:26:01 +0300
committerDmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com>2013-04-16 09:26:01 +0300
commit880cb8aa487a78c22bedb26b3cfd0e1d8590a932 (patch)
tree138a6b10a3b5ac14bbd6d573358be69476efcf65
parent771b5c22987870c84e0bfa90549af1567cb21117 (diff)
downloadgitlab-ce-880cb8aa487a78c22bedb26b3cfd0e1d8590a932.tar.gz
Paginate users in users api
-rw-r--r--doc/api/users.md1
-rw-r--r--lib/api/users.rb1
2 files changed, 2 insertions, 0 deletions
diff --git a/doc/api/users.md b/doc/api/users.md
index c05bcb3e539..ee5e98a016c 100644
--- a/doc/api/users.md
+++ b/doc/api/users.md
@@ -1,6 +1,7 @@
## List users
Get a list of users.
+This function takes pagination parameters `page` and `per_page` to restrict the list of users.
```
GET /users
diff --git a/lib/api/users.rb b/lib/api/users.rb
index 125a8624021..4198387d403 100644
--- a/lib/api/users.rb
+++ b/lib/api/users.rb
@@ -12,6 +12,7 @@ module Gitlab
@users = User.scoped
@users = @users.active if params[:active].present?
@users = @users.search(params[:search]) if params[:search].present?
+ @users = paginate @users
present @users, with: Entities::User
end