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

@@ -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

View File

@@ -19,7 +19,7 @@ defmodule Mobilizon.GraphQL.Schema.ReportType do
field(:uri, :string, description: "The URI of the report", meta: [private: true])
field(:reported, :actor, description: "The actor that is being reported")
field(:reporter, :actor, description: "The actor that created the report")
field(:event, :event, description: "The event that is being reported")
field(:events, list_of(:event), description: "The event that is being reported")
field(:comments, list_of(:comment), description: "The comments that are reported")
field(:notes, list_of(:report_note),
@@ -100,11 +100,15 @@ defmodule Mobilizon.GraphQL.Schema.ReportType do
field :create_report, type: :report do
arg(:content, :string, description: "The message sent with the report")
arg(:reported_id, non_null(:id), description: "The actor's ID that is being reported")
arg(:event_id, :id, default_value: nil, description: "The event ID that is being reported")
arg(:events_ids, list_of(:id),
default_value: [],
description: "The list of event IDs that are being reported"
)
arg(:comments_ids, list_of(:id),
default_value: [],
description: "The comment ID that is being reported"
description: "The comment IDs that are being reported"
)
arg(:forward, :boolean,