Skip to content

Commit

Permalink
[Refactor] 전체 스크랩 게시글 갯수 수정
Browse files Browse the repository at this point in the history
  • Loading branch information
hen715 committed Nov 19, 2024
1 parent 0b6cadf commit 1a242ed
Showing 1 changed file with 2 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -292,6 +292,7 @@ public ListResponseDto getScrapsByMember(Member member, String sort,int page){
})
.sorted(Comparator.comparing(PostListResponseDto::getId).reversed())
.collect(Collectors.toList());
int total = scraps.size();
page--;
int startIndex = 0;
int endIndex = 0;
Expand All @@ -303,7 +304,7 @@ public ListResponseDto getScrapsByMember(Member member, String sort,int page){
startIndex = page*5;
endIndex = Math.min((page + 1) * 5, scraps.size());
}
return ListResponseDto.of(pages,scraps.size(),postListSort(scraps,sort).subList(startIndex,endIndex));
return ListResponseDto.of(pages,total,postListSort(scraps,sort).subList(startIndex,endIndex));
}

@Transactional(readOnly = true)
Expand Down

0 comments on commit 1a242ed

Please sign in to comment.