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

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

module Subscriptions
  module Notes
    class Deleted < Base
      payload_type ::Types::Notes::DeletedNoteType

      DeletedNote = Struct.new(:model_id, :model_name, :discussion_model_id, :last_discussion_note) do
        def to_global_id
          ::Gitlab::GlobalId.as_global_id(model_id, model_name: model_name)
        end

        def discussion_id
          ::Gitlab::GlobalId.as_global_id(discussion_model_id, model_name: Discussion.name)
        end
      end

      def update(*args)
        DeletedNote.new(object[:id], object[:model_name], object[:discussion_id], object[:last_discussion_note])
      end
    end
  end
end