ticket_screen_behavior.rb 640 B

12345678910111213141516171819
  1. # Copyright (C) 2012-2024 Zammad Foundation, https://zammad-foundation.org/
  2. module Gql::Mutations
  3. class User::Current::TicketScreenBehavior < BaseMutation
  4. description 'Update user ticket screen behavior settings'
  5. argument :behavior, Gql::Types::Enum::TicketScreenBehaviorType, description: 'Ticket screen behavior to set'
  6. field :success, Boolean, null: false, description: 'Whether the user ticket screen behavior setting was updated successfully'
  7. def resolve(behavior:)
  8. user = context.current_user
  9. user.preferences['secondaryAction'] = behavior
  10. user.save!
  11. { success: true }
  12. end
  13. end
  14. end