Skip to content

Commit

Permalink
feature(#165) 코드 일부 수정
Browse files Browse the repository at this point in the history
  • Loading branch information
GoosMos committed Feb 18, 2024
1 parent a1b4c42 commit aa25e2f
Showing 1 changed file with 0 additions and 2 deletions.
2 changes: 0 additions & 2 deletions src/controller/postController.js
Original file line number Diff line number Diff line change
Expand Up @@ -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] = []; // 리스트를 생성
Expand All @@ -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 }));
Expand Down

0 comments on commit aa25e2f

Please sign in to comment.