Sha256: 3bc60de7bc72e211389a4ff4545c9d4efcb1ee2396cdeeda6cfcfc3ff953e432
Contents?: true
Size: 1.11 KB
Versions: 25
Compression:
Stored size: 1.11 KB
Contents
# frozen_string_literal: true module Decidim module Initiatives # A command with all the business logic that creates a new initiative. class RevokeMembershipRequest < Rectify::Command # Public: Initializes the command. # # membership_request - A pending committee member def initialize(membership_request) @membership_request = membership_request end # Executes the command. Broadcasts these events: # # - :ok when everything is valid. # # Returns nothing. def call @membership_request.rejected! notify_applicant broadcast(:ok, @membership_request) end private def notify_applicant Decidim::EventsManager.publish( event: "decidim.events.initiatives.revoke_membership_request", event_class: Decidim::Initiatives::RevokeMembershipRequestEvent, resource: @membership_request.initiative, affected_users: [@membership_request.user], force_send: true, extra: { author: @membership_request.initiative.author } ) end end end end
Version data entries
25 entries across 25 versions & 1 rubygems