Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

🐞 BugFix/#54 - νŽ˜μ΄μ§€λ„€μ΄μ…˜ page 데이터 였λ₯˜ μˆ˜μ • #56

Merged
merged 2 commits into from
Nov 22, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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 계산
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

end < storeList.getTotalElements()
end < storeOverviewDtos.size()

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
Loading