update.rb 757 B

123456789101112131415161718192021222324
  1. # Copyright (C) 2012-2024 Zammad Foundation, https://zammad-foundation.org/
  2. module Gql::Mutations
  3. class User::Current::CalendarSubscription::Update < BaseMutation
  4. description 'Fetch calendar subscriptions settings'
  5. argument :input, Gql::Types::Input::User::CalendarSubscriptionsConfigInputType, description: 'Settings to set'
  6. field :success, Boolean, null: false, description: 'Profile appearance settings updated successfully?'
  7. def self.authorize(_obj, ctx)
  8. ctx.current_user.permissions?('user_preferences.calendar+ticket.agent')
  9. end
  10. def resolve(input:)
  11. Service::User::CalendarSubscription::Update
  12. .new(context.current_user, input: input.to_h)
  13. .execute
  14. { success: true }
  15. end
  16. end
  17. end