Fix pagination next link appearing when it shouldn't

This commit is contained in:
Toby Zerner 2021-05-05 14:23:34 +09:30
parent c563c2879b
commit ba4f4d337c
1 changed files with 1 additions and 1 deletions

View File

@ -146,7 +146,7 @@ class Index
$paginationLinks[] = new LastLink($this->buildUrl($request, ['page' => ['offset' => floor(($total - 1) / $limit) * $limit]])); $paginationLinks[] = new LastLink($this->buildUrl($request, ['page' => ['offset' => floor(($total - 1) / $limit) * $limit]]));
} }
if (($total === null && $count === $limit) || $offset + $limit < $total) { if (($total === null && $count === $limit) || $offset + $count < $total) {
$paginationLinks[] = new NextLink($this->buildUrl($request, ['page' => ['offset' => $offset + $limit]])); $paginationLinks[] = new NextLink($this->buildUrl($request, ['page' => ['offset' => $offset + $limit]]));
} }