Send email notifications when a participation is approved/rejected
Also handles participant status :rejected instead of deleting the participation Closes #164 Signed-off-by: Thomas Citharel <tcit@tcit.fr>
This commit is contained in:
@@ -111,6 +111,7 @@ defmodule MobilizonWeb.Schema.EventType do
|
||||
object :participant_stats do
|
||||
field(:approved, :integer, description: "The number of approved participants")
|
||||
field(:unapproved, :integer, description: "The number of unapproved participants")
|
||||
field(:rejected, :integer, description: "The number of rejected participants")
|
||||
end
|
||||
|
||||
object :event_offer do
|
||||
|
||||
@@ -38,6 +38,7 @@ defmodule MobilizonWeb.Schema.Events.ParticipantType do
|
||||
value(:moderator)
|
||||
value(:administrator)
|
||||
value(:creator)
|
||||
value(:rejected)
|
||||
end
|
||||
|
||||
@desc "Represents a deleted participant"
|
||||
@@ -65,19 +66,12 @@ defmodule MobilizonWeb.Schema.Events.ParticipantType do
|
||||
end
|
||||
|
||||
@desc "Accept a participation"
|
||||
field :accept_participation, :participant do
|
||||
field :update_participation, :participant do
|
||||
arg(:id, non_null(:id))
|
||||
arg(:role, non_null(:participant_role_enum))
|
||||
arg(:moderator_actor_id, non_null(:id))
|
||||
|
||||
resolve(&Resolvers.Event.accept_participation/3)
|
||||
end
|
||||
|
||||
@desc "Reject a participation"
|
||||
field :reject_participation, :deleted_participant do
|
||||
arg(:id, non_null(:id))
|
||||
arg(:moderator_actor_id, non_null(:id))
|
||||
|
||||
resolve(&Resolvers.Event.reject_participation/3)
|
||||
resolve(&Resolvers.Event.update_participation/3)
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
Reference in New Issue
Block a user