update.rb 926 B

1234567891011121314151617181920212223242526
  1. # Copyright (C) 2012-2024 Zammad Foundation, https://zammad-foundation.org/
  2. module Gql::Mutations
  3. class Ticket::SharedDraft::Zoom::Update < BaseMutation
  4. description 'Update ticket shared draft in detail view'
  5. argument :shared_draft_id, GraphQL::Types::ID,
  6. loads: Gql::Types::Ticket::SharedDraftZoomType,
  7. description: 'The draft to be updated'
  8. argument :input, Gql::Types::Input::Ticket::SharedDraft::ZoomInputType, description: 'Draft content'
  9. field :shared_draft, Gql::Types::Ticket::SharedDraftZoomType, null: false, description: 'The updated draft.'
  10. def resolve(shared_draft:, input:)
  11. Service::Ticket::SharedDraft::Zoom::Update
  12. .new(
  13. context.current_user, input.form_id, shared_draft,
  14. new_article: input.new_article, ticket_attributes: input.ticket_attributes
  15. )
  16. .execute
  17. { shared_draft: }
  18. end
  19. end
  20. end