Add pagination to moderation logs

Signed-off-by: Thomas Citharel <tcit@tcit.fr>
This commit is contained in:
Thomas Citharel
2021-04-27 17:53:11 +02:00
parent 6646391558
commit 495fbda330
11 changed files with 231 additions and 110 deletions

View File

@@ -36,11 +36,10 @@ defmodule Mobilizon.Admin do
@doc """
Returns the list of action logs.
"""
@spec list_action_logs(integer | nil, integer | nil) :: [ActionLog.t()]
@spec list_action_logs(integer | nil, integer | nil) :: Page.t()
def list_action_logs(page \\ nil, limit \\ nil) do
list_action_logs_query()
|> Page.paginate(page, limit)
|> Repo.all()
|> Page.build_page(page, limit)
end
@doc """