Skip to content

Commit

Permalink
fix : 페이징 처리에서 겹치는 부분이 없도록 limit(pageable.getPageSize()+1) -> limit(p…
Browse files Browse the repository at this point in the history
…ageable.getPageSize()) 로 수정

( 첫번째 인덱스에서 0번부터 size+1 만큼 반환, 두번째 인덱스에서 size번 부터 2*size+1 만큼 반환 )
  • Loading branch information
LHS-11 committed Jan 4, 2024
1 parent bfacca1 commit e69d441
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ public Page<PolicyListResponseDto> searchByPaging(User user, SupportPolicyType s

List<PolicyListResponseDto> results = query.orderBy(policySort(pageable))
.offset(pageable.getOffset())
.limit(pageable.getPageSize() + 1)
.limit(pageable.getPageSize())
.fetch();

return PageableExecutionUtils.getPage(results, pageable, query::fetchCount);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ public Page<NotificationListInfoResponseDto> searchNotificationBySlice(User user

List<NotificationListInfoResponseDto> results = query.orderBy(notification.createdDate.desc())
.offset(pageable.getOffset())
.limit(pageable.getPageSize() + 1)
.limit(pageable.getPageSize())
.fetch();

// return checkLastPage(pageable, results);
Expand Down

0 comments on commit e69d441

Please sign in to comment.