Class: Decidim::Comments::CommentMutationType

Inherits:
Api::Types::BaseObject
  • Object
show all
Defined in:
lib/decidim/api/comment_mutation_type.rb

Instance Method Summary collapse

Instance Method Details

#down_vote(_args: {}) ⇒ Object



21
22
23
24
25
26
27
# File 'lib/decidim/api/comment_mutation_type.rb', line 21

def down_vote(_args: {})
  Decidim::Comments::VoteComment.call(object, current_user, weight: -1) do
    on(:ok) do |comment|
      return comment
    end
  end
end

#up_vote(_args: {}) ⇒ Object



13
14
15
16
17
18
19
# File 'lib/decidim/api/comment_mutation_type.rb', line 13

def up_vote(_args: {})
  Decidim::Comments::VoteComment.call(object, current_user, weight: 1) do
    on(:ok) do |comment|
      return comment
    end
  end
end