reset.rb 542 B

12345678910111213141516
  1. # Copyright (C) 2012-2025 Zammad Foundation, https://zammad-foundation.org/
  2. module Gql::Mutations
  3. class User::Current::RecentView::Reset < BaseMutation
  4. description 'Reset recent view records of the current user'
  5. field :success, Boolean, null: false, description: 'Was the reset successful?'
  6. def resolve
  7. RecentView.where(created_by_id: context.current_user.id).delete_all
  8. Gql::Subscriptions::User::Current::RecentView::Updates.trigger({}, scope: context.current_user.id)
  9. { success: true }
  10. end
  11. end
  12. end