create.rb 756 B

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