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