comments: allow swapping votes.
Allow users to upvote a comment, then downvote it, without raising an error or having to manually remove the upvote first. The upvote is automatically removed and replaced by the downvote. Changes to the /comment_votes API: * `POST /comment_votes` and `DELETE /comment_votes` now return a comment vote instead of a comment. * The `score` param in `POST /comment_votes` is now 1 or -1, not `up` or `down.`
This commit is contained in:
@@ -86,9 +86,7 @@ module Moderator
|
||||
end
|
||||
|
||||
@users.each do |user|
|
||||
CurrentUser.as(user) do
|
||||
@comment.vote!(-1)
|
||||
end
|
||||
create(:comment_vote, score: -1, comment: @comment, user: user)
|
||||
end
|
||||
end
|
||||
|
||||
|
||||
Reference in New Issue
Block a user