diff --git a/src/routes/meme.ts b/src/routes/meme.ts index f3eedda..e64b372 100644 --- a/src/routes/meme.ts +++ b/src/routes/meme.ts @@ -299,7 +299,7 @@ router.get('/list', getRequestedUserInfo, getAllMemeList); // meme 목록 전체 * type: null * example: null */ -router.get('/recommend-memes', getRequestedUserInfo, getLatestMemeList); // 오늘의 추천 밈 (5개) +router.get('/recommend-memes', getRequestedUserInfo, getLatestMemeList); // 오늘의 추천 밈 (20개) /** * @swagger diff --git a/src/service/meme.service.ts b/src/service/meme.service.ts index 2336a47..fab526c 100644 --- a/src/service/meme.service.ts +++ b/src/service/meme.service.ts @@ -67,7 +67,7 @@ async function getLatestCreatedMeme( try { const latestMemeList = await MemeModel.find({ isDeleted: false }, { isDeleted: 0 }) .limit(limit) - .sort({_id: -1}) + .sort({ _id: -1 }) .lean(); const memeList = await getMemeListWithKeywordsAndisSavedAndisReaction(user, latestMemeList); @@ -311,14 +311,14 @@ async function createMemeInteraction( if (_.isNull(memeInteraction)) { // 신규 생성 await MemeInteractionService.createMemeInteraction(user, meme, interactionType); - } else { - logger.info( - `Already ${interactionType} meme - deviceId(${user.deviceId}), memeId(${meme._id})`, - ); - - // interactionType에 따른 동작 처리 (MemeInteracionService에서 진행) - await MemeInteractionService.updateMemeInteraction(user, meme, interactionType, count); } + logger.info( + `Already ${interactionType} meme - deviceId(${user.deviceId}), memeId(${meme._id})`, + ); + + // interactionType에 따른 동작 처리 (MemeInteracionService에서 진행) + await MemeInteractionService.updateMemeInteraction(user, meme, interactionType, count); + return true; } catch (err) { throw new CustomError( diff --git a/src/service/memeInteraction.service.ts b/src/service/memeInteraction.service.ts index eb61d2e..e736a95 100644 --- a/src/service/memeInteraction.service.ts +++ b/src/service/memeInteraction.service.ts @@ -149,7 +149,6 @@ async function updateMemeInteraction( break; // 'reaction' Meme.reaction count 올리기 - // User의 'reaction' count는 밈당 1번 case InteractionType.REACTION: await MemeModel.findOneAndUpdate( { _id: meme._id, isDeleted: false },