triggers_subscriptions.rb 464 B

123456789101112131415161718
  1. # Copyright (C) 2012-2024 Zammad Foundation, https://zammad-foundation.org/
  2. # Trigger GraphQL subscriptions on public link changes.
  3. module PublicLink::TriggersSubscriptions
  4. extend ActiveSupport::Concern
  5. included do
  6. after_commit :trigger_subscriptions
  7. end
  8. private
  9. def trigger_subscriptions
  10. PublicLink::AVAILABLE_SCREENS.each do |screen|
  11. Gql::Subscriptions::PublicLinkUpdates.trigger(nil, arguments: { screen: screen })
  12. end
  13. end
  14. end