Merge branch 'feature/return-total-for-reports' into 'develop'
Admin API: Return total for reports See merge request pleroma/pleroma!1628
This commit is contained in:
commit
ef2e2c5e12
5 changed files with 15 additions and 5 deletions
|
|
@ -442,11 +442,9 @@ defmodule Pleroma.Web.AdminAPI.AdminAPIController do
|
|||
params
|
||||
|> Map.put("type", "Flag")
|
||||
|> Map.put("skip_preload", true)
|
||||
|> Map.put("total", true)
|
||||
|
||||
reports =
|
||||
[]
|
||||
|> ActivityPub.fetch_activities(params)
|
||||
|> Enum.reverse()
|
||||
reports = ActivityPub.fetch_activities([], params)
|
||||
|
||||
conn
|
||||
|> put_view(ReportView)
|
||||
|
|
|
|||
|
|
@ -12,7 +12,9 @@ defmodule Pleroma.Web.AdminAPI.ReportView do
|
|||
|
||||
def render("index.json", %{reports: reports}) do
|
||||
%{
|
||||
reports: render_many(reports, __MODULE__, "show.json", as: :report)
|
||||
reports:
|
||||
render_many(reports[:items], __MODULE__, "show.json", as: :report) |> Enum.reverse(),
|
||||
total: reports[:total]
|
||||
}
|
||||
end
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue