Commit 880cb8aa authored by Dmitriy Zaporozhets's avatar Dmitriy Zaporozhets
Browse files

Paginate users in users api

parent 4463f2587d27
## List users
Get a list of users.
This function takes pagination parameters `page` and `per_page` to restrict the list of users.
```
GET /users
......
......@@ -12,6 +12,7 @@ class Users < Grape::API
@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
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment