Skip to content

Commit

Permalink
Fix: 북마크 목록 조회 API 에러 수정(weekly -> master) Merge
Browse files Browse the repository at this point in the history
Fix: 북마크 목록 조회 API 에러 수정(weekly -> master)
  • Loading branch information
Train0303 authored Nov 11, 2023
2 parents f48da33 + 278d4ad commit 5e0514d
Showing 1 changed file with 8 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -64,9 +64,14 @@ public List<BookmarkResponseDto.BookmarkGetResponseDto> getRecentBookmark(Pageab
.toList()
);

Map<Bookmark, List<Tag>> bookmarkTagListMap = bookmarkTagList.stream()
.collect(groupingBy(BookmarkTag::getBookmark
, Collectors.mapping(BookmarkTag::getTag, toList())));
Map<Bookmark, List<Tag>> bookmarkTagListMap = new HashMap<>();
for(Bookmark bookmark : bookmarkList) {
bookmarkTagListMap.put(bookmark, new ArrayList<>());
}

for(BookmarkTag bookmarkTag : bookmarkTagList) {
bookmarkTagListMap.get(bookmarkTag.getBookmark()).add(bookmarkTag.getTag());
}

return bookmarkList.stream()
.map(bookmark -> BookmarkResponseDto.BookmarkGetResponseDto.of(bookmark, bookmarkTagListMap.get(bookmark)))
Expand Down

0 comments on commit 5e0514d

Please sign in to comment.