Merge branch 'develop' into tests/mastodon_api_controller.ex
This commit is contained in:
commit
b4fc96f640
8 changed files with 343 additions and 105 deletions
|
|
@ -556,7 +556,15 @@ defmodule Pleroma.Web.AdminAPI.AdminAPIController do
|
|||
def list_log(conn, params) do
|
||||
{page, page_size} = page_params(params)
|
||||
|
||||
log = ModerationLog.get_all(page, page_size)
|
||||
log =
|
||||
ModerationLog.get_all(%{
|
||||
page: page,
|
||||
page_size: page_size,
|
||||
start_date: params["start_date"],
|
||||
end_date: params["end_date"],
|
||||
user_id: params["user_id"],
|
||||
search: params["search"]
|
||||
})
|
||||
|
||||
conn
|
||||
|> put_view(ModerationLogView)
|
||||
|
|
|
|||
|
|
@ -8,7 +8,10 @@ defmodule Pleroma.Web.AdminAPI.ModerationLogView do
|
|||
alias Pleroma.ModerationLog
|
||||
|
||||
def render("index.json", %{log: log}) do
|
||||
render_many(log, __MODULE__, "show.json", as: :log_entry)
|
||||
%{
|
||||
items: render_many(log.items, __MODULE__, "show.json", as: :log_entry),
|
||||
total: log.count
|
||||
}
|
||||
end
|
||||
|
||||
def render("show.json", %{log_entry: log_entry}) do
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue