create.rb 763 B

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