Skip to content

Commit

Permalink
🐞 bugfix/#54 : page 데이터 λ‘œλ“œ 였λ₯˜ μˆ˜μ •
Browse files Browse the repository at this point in the history
Signed-off-by: EunJiJung <[email protected]>
  • Loading branch information
bianbbc87 committed Nov 22, 2024
1 parent 93a1206 commit 67c0e0f
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ public ReadStoreOverviewsResponseDto execute(
// title null 처리
title = storeService.convertToTitle(title);

Page<Store> storeList = storeRepository.findStoresByEarliestEventOrdered(title, onjungTagsList, pageable);
List<Store> storeList = storeRepository.findStoresByEarliestEventOrdered(title, onjungTagsList);

// 상점이 없을 경우
if (storeList.isEmpty()) {
Expand Down Expand Up @@ -71,7 +71,7 @@ public ReadStoreOverviewsResponseDto execute(
int end = Math.min(start + pageable.getPageSize(), storeOverviewDtos.size());
List<ReadStoreOverviewsResponseDto.StoreOverviewDto> pagedStoreOverviewDtos = storeOverviewDtos.subList(start, end);

// 응닡 생성
// 응닡 생성
return ReadStoreOverviewsResponseDto.fromEntity(
pagedStoreOverviewDtos,
end < storeList.getTotalElements() // hasNext 계산
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,10 +33,9 @@ public interface StoreRepository extends JpaRepository <Store, Long> {
"AND (:onjungTags IS NULL OR tag IN :onjungTags) " +
"GROUP BY s.id " +
"ORDER BY MIN(e.endDate) ASC")
Page<Store> findStoresByEarliestEventOrdered(
List<Store> findStoresByEarliestEventOrdered(
@Param("title") String title,
@Param("onjungTags") List<EOnjungTag> onjungTags,
Pageable pageable
@Param("onjungTags") List<EOnjungTag> onjungTags
);

@Query("SELECT COUNT(s) FROM Share s WHERE s.store.id = :storeId")
Expand Down

0 comments on commit 67c0e0f

Please sign in to comment.