Skip to content

Commit

Permalink
Merge pull request #202 from Upjuyanolja/bugfix/selectAccommodation
Browse files Browse the repository at this point in the history
fix: 숙소 검색 결과가 없을 경우 빈 리스트 반환
  • Loading branch information
JeongUijeong authored Jan 27, 2024
2 parents faf0fd2 + 3b99943 commit ec329bf
Showing 1 changed file with 6 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -84,6 +84,12 @@ public AccommodationPageResponse findAccommodations(
Page<Accommodation> accommodations = accommodationRepository
.searchPageByCategoryWithTypeAndName(category, keyword, pageable);

if (accommodations.isEmpty()) {
return AccommodationPageResponse.builder()
.accommodations(new ArrayList<>())
.build();
}

return AccommodationPageResponse.of(
new PageImpl<>(
accommodations.stream()
Expand Down

0 comments on commit ec329bf

Please sign in to comment.