View Source Mobilizon.Events.Participant (Mobilizon v5.0.0-beta.1)

Represents a participant, an actor participating to an event.

Summary

Functions

We check that the actor asking to leave the event is not it's only organizer. We start by fetching the list of organizers and if there's only one of them and that it's the actor requesting leaving the event we return true.

Types

@type t() :: %Mobilizon.Events.Participant{
  __meta__: term(),
  actor: Mobilizon.Actors.Actor.t(),
  actor_id: term(),
  code: String.t(),
  event: Mobilizon.Events.Event.t(),
  event_id: term(),
  id: String.t(),
  inserted_at: term(),
  metadata: map(),
  role: atom(),
  updated_at: term(),
  url: String.t()
}

Functions

Link to this function

not_only_organizer?(event_id, actor_id)

View Source
@spec not_only_organizer?(integer() | String.t(), integer() | String.t()) :: boolean()

We check that the actor asking to leave the event is not it's only organizer. We start by fetching the list of organizers and if there's only one of them and that it's the actor requesting leaving the event we return true.