Add pagination to users admin API
This commit is contained in:
parent
14bc6bd40f
commit
2883f75a3a
4 changed files with 51 additions and 19 deletions
|
|
@ -27,9 +27,12 @@ defmodule Pleroma.Web.TwitterAPI.UserView do
|
|||
else: %{}
|
||||
end
|
||||
|
||||
def render("index_for_admin.json", %{users: users} = opts) do
|
||||
users
|
||||
|> render_many(UserView, "show_for_admin.json", opts)
|
||||
def render("index_for_admin.json", %{users: users, count: count, page_size: page_size} = opts) do
|
||||
%{
|
||||
users: render_many(users, UserView, "show_for_admin.json", opts),
|
||||
count: count,
|
||||
page_size: page_size
|
||||
}
|
||||
end
|
||||
|
||||
def render("show_for_admin.json", %{user: user}) do
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue