fix pagination
This commit is contained in:
parent
ddd5bc504e
commit
68c0f597ca
@ -46,10 +46,10 @@ public class GitFilteringController {
|
|||||||
|
|
||||||
Page<Commit> commitsPage = filteringService.getCommits(repositoryUrl,
|
Page<Commit> commitsPage = filteringService.getCommits(repositoryUrl,
|
||||||
branchName,
|
branchName,
|
||||||
new OffsetablePageRequest(currentPage, pageSize));
|
new OffsetablePageRequest(currentPage - 1, pageSize));
|
||||||
int totalPages = commitsPage.getTotalPages();
|
int totalPages = commitsPage.getTotalPages();
|
||||||
if (totalPages > 0) {
|
if (totalPages > 0) {
|
||||||
List<Integer> pageNumbers = IntStream.rangeClosed(1, totalPages - 1)
|
List<Integer> pageNumbers = IntStream.rangeClosed(1, totalPages)
|
||||||
.boxed()
|
.boxed()
|
||||||
.collect(Collectors.toList());
|
.collect(Collectors.toList());
|
||||||
model.addAttribute("pageNumbers", pageNumbers);
|
model.addAttribute("pageNumbers", pageNumbers);
|
||||||
|
Loading…
Reference in New Issue
Block a user