From aa25e2fab84d14040a823e1f9469fba3aeb29432 Mon Sep 17 00:00:00 2001 From: Goosmos Date: Sun, 18 Feb 2024 11:46:11 +0900 Subject: [PATCH] =?UTF-8?q?feature(#165)=20=EC=BD=94=EB=93=9C=20=EC=9D=BC?= =?UTF-8?q?=EB=B6=80=20=EC=88=98=EC=A0=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/controller/postController.js | 2 -- 1 file changed, 2 deletions(-) diff --git a/src/controller/postController.js b/src/controller/postController.js index 2754a58..85978e0 100644 --- a/src/controller/postController.js +++ b/src/controller/postController.js @@ -79,7 +79,6 @@ export const viewPost = async (req, res, next) => { try { const { _id, email } = req.user; const postId = req.params.id; - // const post = await Post.findOneAndUpdate({ _id: postId }, { $inc: { watch_count: +1 } }, { new: true }); const post = await Post.findById({ _id: postId }); if (!viewObj[postId]) viewObj[postId] = []; // 리스트를 생성 @@ -96,7 +95,6 @@ export const viewPost = async (req, res, next) => { if (i.length == 0) delete viewObj.i; } - if (post.like_users.includes(_id)) { // 이미 좋아요를 누른 사람인 경우 let userLiked = true; return res.send(response(status.SUCCESS, { userLiked, post }));