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:
evazion
2021-01-21 01:02:22 -06:00
parent c31f2003d9
commit 9efb374ae5
12 changed files with 181 additions and 133 deletions

View File

@@ -42,6 +42,12 @@
`creator_id`, `updater_id`, and `body` fields are hidden if you're not a
moderator.
* The `POST /comment_votes` and `DELETE /comment_votes` endpoints now return a
comment vote instead of a comment.
* The `score` param in the `POST /comment_votes` endpoint is now 1 or -1, not
`up` or `down`.
## 2021-01-12
### Changes