Skip to content

Commit

Permalink
feat: 키워드 삭제 시 밈에서도 삭제하도록 변경
Browse files Browse the repository at this point in the history
  • Loading branch information
seohyun0120 committed Jun 29, 2024
1 parent 14e614b commit 90cb9f9
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions src/service/meme.service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -148,6 +148,13 @@ async function deleteMeme(memeId: Types.ObjectId): Promise<boolean> {
return true;
}

async function deleteKeywordOfMeme(deleteKeywordId: Types.ObjectId) {
await MemeModel.updateMany(
{ keywordIds: deleteKeywordId },
{ $pull: { keywordIds: deleteKeywordId } },
);
}

export {
getMeme,
getMemeWithKeywords,
Expand All @@ -156,4 +163,5 @@ export {
deleteMeme,
getTodayMemeList,
getAllMemeList,
deleteKeywordOfMeme,
};

0 comments on commit 90cb9f9

Please sign in to comment.