Don't show next link if there are no more models
This commit is contained in:
parent
4cb2085987
commit
b63ba9d164
|
|
@ -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]]));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue