feat(reports): allow reports to hold multiple events

Signed-off-by: Thomas Citharel <tcit@tcit.fr>
This commit is contained in:
Thomas Citharel
2023-06-05 18:32:29 +02:00
parent 538139eefa
commit f2ac3e2e5d
21 changed files with 185 additions and 104 deletions

View File

@@ -139,7 +139,7 @@ defmodule Mobilizon.Service.AntiSpam.Akismet do
end
end
defp report_to_akismet_comment(%Report{event: %Event{id: event_id}}) do
defp report_to_akismet_comment(%Report{events: [%Event{id: event_id} | _]}) do
with %Event{description: body, organizer_actor: %Actor{} = actor} <-
Events.get_event_with_preload!(event_id),
{email, preferred_username, ip} <- actor_details(actor) do