delete.rb 539 B

123456789101112131415161718
  1. # Copyright (C) 2012-2024 Zammad Foundation, https://zammad-foundation.org/
  2. module Gql::Mutations
  3. class Ticket::LiveUser::Delete < Ticket::LiveUser::Base
  4. description 'Deletes the desired live user entry.'
  5. field :success, Boolean, null: false, description: 'Was the live user entry deletion successful?'
  6. def resolve(ticket:, app:)
  7. taskbar_key = taskbar_key(ticket.id)
  8. taskbar_item = taskbar_item(taskbar_key, app)
  9. taskbar_item.destroy! if taskbar_item.present?
  10. { success: true }
  11. end
  12. end
  13. end