Skip to content

Commit

Permalink
Fix pagination to start from page 1 instead of 0.
Browse files Browse the repository at this point in the history
Previously, the pagination logic treated negative and zero page indices the same, defaulting to 0. This change ensures that the first page starts from 1, aligning with typical pagination conventions.

Signed-off-by: rooki <[email protected]>
  • Loading branch information
Pdzly committed Aug 9, 2024
1 parent 791a596 commit 48ef59a
Showing 1 changed file with 1 addition and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ public Results setPerPage(final Integer perPage) {

public Results setPage(final Integer page) {

int p = Math.max(Math.abs(page), 0);
int p = Math.max(Math.abs(page), 1);
getQuery().setFirstResult((p - 1) * this.getPerPage());
return this;
}
Expand Down

0 comments on commit 48ef59a

Please sign in to comment.