fixes #2822: Post vote API: returns 200 for both success and failure; fixes bug with x-api-limit header
This commit is contained in:
@@ -1075,7 +1075,7 @@ class Post < ActiveRecord::Base
|
||||
raise PostVote::Error.new("You have already voted for this post")
|
||||
end
|
||||
|
||||
PostVote.create(:post_id => id, :score => score)
|
||||
PostVote.create!(:post_id => id, :score => score)
|
||||
reload # PostVote.create modifies our score. Reload to get the new score.
|
||||
end
|
||||
|
||||
|
||||
Reference in New Issue
Block a user