debian-mirror-gitlab/app/graphql/mutations/notes/destroy.rb

27 lines
528 B
Ruby
Raw Normal View History

2019-09-30 21:07:59 +05:30
# frozen_string_literal: true
module Mutations
module Notes
class Destroy < Base
graphql_name 'DestroyNote'
authorize :admin_note
argument :id,
2021-01-03 14:25:43 +05:30
::Types::GlobalIDType[::Note],
required: true,
description: 'The global id of the note to destroy'
2019-09-30 21:07:59 +05:30
def resolve(id:)
note = authorized_find!(id: id)
::Notes::DestroyService.new(note.project, current_user).execute(note)
{
errors: []
}
end
end
end
end