Skip to content

Commit 19a1e8e

Browse files
authored
Merge pull request #219 from TeamLearningFlow/develop
Develop
2 parents d32b032 + 84aad46 commit 19a1e8e

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

src/main/java/learningFlow/learningFlow_BE/service/collection/CollectionService.java

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -117,7 +117,8 @@ public CollectionResponseDTO.SearchResultDTO search(SearchRequestDTO.SearchCondi
117117
Map<Long, CollectionResponseDTO.CollectionLearningInfo> learningInfoMap = collections.stream()
118118
.collect(Collectors.toMap(
119119
Collection::getId,
120-
collection -> getLearningInfo(collection, currentUser, false)
120+
collection -> getLearningInfo(collection, currentUser, false),
121+
(existing, replacement) -> replacement // added: 중복 키가 있을 경우 새 값 사용
121122
));
122123

123124
return CollectionConverter.toSearchResultDTO(
@@ -384,7 +385,8 @@ public HomeResponseDTO.UserHomeInfoDTO getUserHomeCollections(User user) {
384385
Map<Long, CollectionResponseDTO.CollectionLearningInfo> learningInfoMap = recommendedCollections.stream()
385386
.collect(Collectors.toMap(
386387
Collection::getId,
387-
collection -> getLearningInfo(collection, user, false)
388+
collection -> getLearningInfo(collection, user, false),
389+
(existing, replacement) -> replacement // added: 중복 키가 있을 경우 새 값 사용
388390
));
389391

390392
return HomeConverter.convertToUserHomeInfoDTO(

0 commit comments

Comments
 (0)