From be32fc6c1300aafafccf78da30ed30706f8faed2 Mon Sep 17 00:00:00 2001 From: alsotang Date: Wed, 18 Oct 2017 11:04:28 +0800 Subject: [PATCH] fix api topic is_uped --- api/v1/topic.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/api/v1/topic.js b/api/v1/topic.js index 3efb2ed..ea7bf2c 100644 --- a/api/v1/topic.js +++ b/api/v1/topic.js @@ -94,7 +94,7 @@ var show = function (req, res, next) { reply = _.pick(reply, ['id', 'author', 'content', 'ups', 'create_at', 'reply_id']); reply.reply_id = reply.reply_id || null; - if (reply.ups && req.user && reply.ups.indexOf(req.user.id) != -1) { + if (reply.ups && req.user && reply.ups.indexOf(req.user._id) != -1) { reply.is_uped = true; } else { reply.is_uped = false;