Sha256: 98adba7724847d5d5191b10b43a46331d46724df1d8ac770d2791fc0a53d339b
Contents?: true
Size: 1.13 KB
Versions: 2
Compression:
Stored size: 1.13 KB
Contents
# frozen_string_literal: true module Decidim module Initiatives # A command with all the business logic that creates a new initiative. class RevokeMembershipRequest < Decidim::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: { id: @membership_request.initiative.author&.id } } ) end end end end
Version data entries
2 entries across 2 versions & 1 rubygems
Version | Path |
---|---|
decidim-initiatives-0.29.1 | app/commands/decidim/initiatives/revoke_membership_request.rb |
decidim-initiatives-0.28.4 | app/commands/decidim/initiatives/revoke_membership_request.rb |