2019-07-01 00:34:34 -04:00
|
|
|
# frozen_string_literal: true
|
|
|
|
|
|
|
|
module Mutations
|
|
|
|
module Notes
|
|
|
|
class Destroy < Base
|
|
|
|
graphql_name 'DestroyNote'
|
|
|
|
|
|
|
|
authorize :admin_note
|
|
|
|
|
|
|
|
argument :id,
|
2020-10-07 23:08:39 -04:00
|
|
|
::Types::GlobalIDType[::Note],
|
|
|
|
required: true,
|
2021-08-17 20:11:18 -04:00
|
|
|
description: 'Global ID of the note to destroy.'
|
2019-07-01 00:34:34 -04:00
|
|
|
|
|
|
|
def resolve(id:)
|
|
|
|
note = authorized_find!(id: id)
|
|
|
|
|
|
|
|
::Notes::DestroyService.new(note.project, current_user).execute(note)
|
|
|
|
|
|
|
|
{
|
|
|
|
errors: []
|
|
|
|
}
|
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|