Welcome to mirror list, hosted at ThFree Co, Russian Federation.

destroy.rb « notes « mutations « graphql « app - gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
blob: 21b2cd15a7ecbe581a75e70c4f3fff59c247aa99 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
# frozen_string_literal: true

module Mutations
  module Notes
    class Destroy < Base
      graphql_name 'DestroyNote'

      authorize :admin_note

      argument :id,
               ::Types::GlobalIDType[::Note],
               required: true,
               description: 'The global ID of the note to destroy.'

      def resolve(id:)
        note = authorized_find!(id: id)

        ::Notes::DestroyService.new(note.project, current_user).execute(note)

        {
          errors: []
        }
      end
    end
  end
end