Don't show next link if there are no more models

This commit is contained in:
Toby Zerner 2019-10-03 15:41:22 +09:30
parent 4cb2085987
commit b63ba9d164
1 changed files with 1 additions and 1 deletions

View File

@ -95,7 +95,7 @@ class Index implements RequestHandlerInterface
$models = $adapter->get($query); $models = $adapter->get($query);
if ((count($models) && $total === null) || $offset + $limit < $total) { if ((count($models) === $limit && $total === null) || $offset + $limit < $total) {
$paginationLinks[] = new NextLink($this->buildUrl($request, ['page' => ['offset' => $offset + $limit]])); $paginationLinks[] = new NextLink($this->buildUrl($request, ['page' => ['offset' => $offset + $limit]]));
} }