AdminAPI: Fix grouped reports for closed/resolved reports

This commit is contained in:
Maxim Filippov 2019-11-25 01:39:35 +09:00
parent 40059c9b1e
commit 1364d303f8

View file

@ -852,7 +852,8 @@ defp get_status_data(activity) do
def get_reports_by_status_id(ap_id) do def get_reports_by_status_id(ap_id) do
from(a in Activity, from(a in Activity,
where: fragment("(?)->>'type' = 'Flag'", a.data), where: fragment("(?)->>'type' = 'Flag'", a.data),
where: fragment("(?)->'object' @> ?", a.data, ^[%{id: ap_id}]) where: fragment("(?)->'object' @> ?", a.data, ^[%{id: ap_id}]),
or_where: fragment("(?)->'object' @> ?", a.data, ^[ap_id])
) )
|> Activity.with_preloaded_user_actor() |> Activity.with_preloaded_user_actor()
|> Repo.all() |> Repo.all()