feat(reports): improve reportview and allow removing content + resolve report automatically

Signed-off-by: Thomas Citharel <tcit@tcit.fr>
This commit is contained in:
Thomas Citharel
2023-08-31 14:37:54 +02:00
parent f2ac3e2e5d
commit b105c508c0
7 changed files with 230 additions and 94 deletions

View File

@@ -34,7 +34,10 @@ defmodule Mobilizon.Federation.ActivityPub.Types.Reports do
{:error, :event_not_found} -> nil
end
end)
|> Enum.filter(& &1)
|> Enum.filter(fn event ->
is_struct(event) and
Enum.member?([event.organizer_actor_id, event.attributed_to_id], reported_actor.id)
end)
comments =
Discussions.list_comments_by_actor_and_ids(

View File

@@ -67,7 +67,7 @@ defmodule Mobilizon.GraphQL.Resolvers.Report do
{:ok, _, %Report{} = report} ->
{:ok, report}
error ->
_error ->
{:error, dgettext("errors", "Error while saving report")}
end
end