Commit 5a1dcfde by Rocky Duan

tiny commit bug

parent 94018746
...@@ -110,7 +110,7 @@ put '/api/v1/votes/comments/:comment_id/users/:user_id' do |comment_id, user_id| ...@@ -110,7 +110,7 @@ put '/api/v1/votes/comments/:comment_id/users/:user_id' do |comment_id, user_id|
vote = user.vote(comment, { :direction => (params["value"] == "up" ? :up : :down ), :exclusive => :true}) vote = user.vote(comment, { :direction => (params["value"] == "up" ? :up : :down ), :exclusive => :true})
vote.to_json vote.to_json
else else
error 400, {:error => "value must be up or down"} error 400, {:error => "value must be up or down"}.to_json
end end
end end
end end
...@@ -124,7 +124,7 @@ delete '/api/v1/votes/comments/:comment_id/users/:user_id' do |comment_id, user_ ...@@ -124,7 +124,7 @@ delete '/api/v1/votes/comments/:comment_id/users/:user_id' do |comment_id, user_
vote = user.unvote_for(comment) vote = user.unvote_for(comment)
vote.to_json vote.to_json
else else
error 400, {:error => "invalid user or comment id"} error 400, {:error => "invalid user or comment id"}.to_json
end end
end end
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment