Skip to content

Commit

Permalink
♻️ refactor: 검색 응답 제한 하향 조정 (50->30) (#82)
Browse files Browse the repository at this point in the history
  • Loading branch information
loveysuby committed Sep 29, 2024
1 parent 22167c2 commit a0df7df
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,8 @@ private List<GroupResponse> findRegisteredGroups(Long userId) {
}

private List<GroupResponse> findGroupsByKeywords(String keyword) {
return groupRepository.findTop50ByNameLike(keyword).stream()
String keywordWithWildcard = "%" + keyword + "%";
return groupRepository.findTop30ByNameLike(keywordWithWildcard).stream()
.map(each -> new GroupResponse(each.getId(), each.getName()))
.toList();
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,5 +6,5 @@

public interface GroupRepository extends JpaRepository<Group, Long> {

List<Group> findTop50ByNameLike(String keyword);
List<Group> findTop30ByNameLike(String keyword);
}

0 comments on commit a0df7df

Please sign in to comment.