Skip to content

Commit

Permalink
hotfix: 최근 북마크 된 카드 조회 쿼리 수정
Browse files Browse the repository at this point in the history
  • Loading branch information
DongLee99 committed Nov 20, 2023
1 parent 2f2eb77 commit 8a303ea
Showing 1 changed file with 0 additions and 7 deletions.
7 changes: 0 additions & 7 deletions src/services/cardService.ts
Original file line number Diff line number Diff line change
Expand Up @@ -125,16 +125,9 @@ const findRecentlyBookmarkedCard = async (userId?: Types.ObjectId) => {
const bookmarks: BookmarkDocument[] = await Bookmark.aggregate()
.sort({ createdAt: -1 })
.limit(20);
console.log(bookmarks.length);
for (const bookmark of bookmarks) {
console.log(bookmark.createdAt);
}
const cards: CardDocument[] = (
await Promise.all(bookmarks.map(bookmark => Card.findById(bookmark.card)))
).filter(util.isNotEmpty);
for (const card of cards) {
console.log(card.content);
}
const totalCards: CardResponseDto[] = [];
for (const card of cards) {
totalCards.push(await createCardResponse(card, userId));
Expand Down

0 comments on commit 8a303ea

Please sign in to comment.