class Decidim::Meetings::Admin::ExportMeetingRegistrations

a Meeting from the admin panel.
This command is executed when the user exports the registrations of

def call

Broadcasts :ok if successful, :invalid otherwise.

Exports the meeting registrations.
def call
  broadcast(:ok, export_data)
end

def export_data

def export_data
  Decidim.traceability.perform_action!(
    :export_registrations,
    meeting,
    current_user
  ) do
    Decidim::Exporters
      .find_exporter(format)
      .new(meeting.registrations, Decidim::Meetings::RegistrationSerializer)
      .export
  end
end

def initialize(meeting, format, current_user)

current_user - the user performing the action
format - a string representing the export format
meeting - The current instance of the page to be closed.
def initialize(meeting, format, current_user)
  @meeting = meeting
  @format = format
  @current_user = current_user
end