taskbar_item_state_updates.rb 705 B

1234567891011121314151617181920
  1. # Copyright (C) 2012-2024 Zammad Foundation, https://zammad-foundation.org/
  2. module Gql::Subscriptions
  3. class User::Current::TaskbarItemStateUpdates < BaseSubscription
  4. description 'Changes to the state of a taskbar item of the currently logged-in user'
  5. argument :taskbar_item_id, GraphQL::Types::ID, required: true, loads: Gql::Types::User::TaskbarItemType, description: 'The taskbar item ID'
  6. field :state_changed, Boolean, description: 'Signals that the taskbar item state has changed'
  7. def authorized?(taskbar_item:)
  8. taskbar_item.present? && taskbar_item.user_id == context.current_user.id
  9. end
  10. def update(taskbar_item:)
  11. { state_changed: true }
  12. end
  13. end
  14. end