comment votes: fix error handling.

Return the comment itself and a standard error response on failure.
This commit is contained in:
evazion
2019-08-19 16:57:38 -05:00
parent b8450671f2
commit 782d9f3d61
8 changed files with 19 additions and 48 deletions

View File

@@ -1,8 +1,4 @@
<% if @error %>
Danbooru.error("<%= j @error.to_s %>");
<% elsif @comment_vote.errors.any? %>
Danbooru.error("<%= j @comment_vote.errors.full_messages.join('; ') %>");
<% elsif @comment_vote.is_negative? %>
<% if @comment_vote.is_negative? %>
$(".comment[data-comment-id=<%= @comment.id %>]").remove();
<% end %>