base.rb 630 B

12345678910111213141516171819
  1. # Copyright (C) 2012-2024 Zammad Foundation, https://zammad-foundation.org/
  2. module Gql::Mutations
  3. class Ticket::LiveUser::Base < BaseMutation # rubocop:disable GraphQL/ObjectDescription
  4. argument :id, GraphQL::Types::ID, loads: Gql::Types::TicketType, as: :ticket, description: 'The ticket which is currently visited.'
  5. argument :app, Gql::Types::Enum::TaskbarAppType, description: 'Taskbar app to filter for.'
  6. protected
  7. def taskbar_key(ticket_id)
  8. "Ticket-#{ticket_id}"
  9. end
  10. def taskbar_item(key, app)
  11. Taskbar.find_by(key: key, user_id: context.current_user.id, app: app)
  12. end
  13. end
  14. end