Files
danbooru/app/views/post_votes/create.js.erb
evazion f6b737103a post votes: fix error handling.
* Clean up javascript.
* Return HTTP 422 instead of HTTP 500 on "you have already voted for
  this post" errors.
* In json/xml error responses, return the error message in the `message`
  field, not `reason`.
* In json/xml success responses, return the post itself instead of a
  plain `{ success: true }` object.
2019-08-13 21:30:20 -05:00

6 lines
204 B
Plaintext

Danbooru.Utility.notice("Vote saved");
$("#score-for-post-<%= @post.id %>").html(<%= @post.score %>);
$("#vote-links-for-post-<%= @post.id %>").hide();
$("#unvote-link-for-post-<%= @post.id %>").show();