update.rb 855 B

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