Sha256: ecb9be5a402c7795423b955ef6bc8ea5f7905c6863444b113c0ae22729e73ca6

Contents?: true

Size: 725 Bytes

Versions: 21

Compression:

Stored size: 725 Bytes

Contents

# frozen_string_literal: true

module Hyrax
  module Listeners
    ##
    # Listens for events related to batch activity and creates notifications
    class BatchNotificationListener
      ##
      # Notify requesting users of batch success/failure
      #
      # Called when 'batch.created' event is published
      # @param [Dry::Events::Event] event
      # @return [void]
      def on_batch_created(event)
        case event[:result]
        when :success
          Hyrax::BatchCreateSuccessService
            .new(event[:user])
            .call
        when :failure
          Hyrax::BatchCreateFailureService
            .new(event[:user], event[:messages])
            .call
        end
      end
    end
  end
end

Version data entries

21 entries across 21 versions & 1 rubygems

Version Path
hyrax-5.1.0.pre.beta1 app/services/hyrax/listeners/batch_notification_listener.rb
hyrax-5.0.4 app/services/hyrax/listeners/batch_notification_listener.rb
hyrax-5.0.3 app/services/hyrax/listeners/batch_notification_listener.rb
hyrax-5.0.2 app/services/hyrax/listeners/batch_notification_listener.rb
hyrax-5.0.1 app/services/hyrax/listeners/batch_notification_listener.rb
hyrax-5.0.0 app/services/hyrax/listeners/batch_notification_listener.rb
hyrax-5.0.0.rc3 app/services/hyrax/listeners/batch_notification_listener.rb
hyrax-5.0.0.rc2 app/services/hyrax/listeners/batch_notification_listener.rb
hyrax-5.0.0.rc1 app/services/hyrax/listeners/batch_notification_listener.rb
hyrax-3.6.0 app/services/hyrax/listeners/batch_notification_listener.rb
hyrax-4.0.0 app/services/hyrax/listeners/batch_notification_listener.rb
hyrax-4.0.0.rc3 app/services/hyrax/listeners/batch_notification_listener.rb
hyrax-4.0.0.rc2 app/services/hyrax/listeners/batch_notification_listener.rb
hyrax-4.0.0.rc1 app/services/hyrax/listeners/batch_notification_listener.rb
hyrax-3.5.0 app/services/hyrax/listeners/batch_notification_listener.rb
hyrax-4.0.0.beta2 app/services/hyrax/listeners/batch_notification_listener.rb
hyrax-3.4.2 app/services/hyrax/listeners/batch_notification_listener.rb
hyrax-4.0.0.beta1 app/services/hyrax/listeners/batch_notification_listener.rb
hyrax-3.4.1 app/services/hyrax/listeners/batch_notification_listener.rb
hyrax-3.4.0 app/services/hyrax/listeners/batch_notification_listener.rb