From ba4f4d337c04eb7f8bf2fdef7b70a50883638ff3 Mon Sep 17 00:00:00 2001 From: Toby Zerner Date: Wed, 5 May 2021 14:23:34 +0930 Subject: [PATCH] Fix pagination next link appearing when it shouldn't --- src/Endpoint/Index.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Endpoint/Index.php b/src/Endpoint/Index.php index 75ba32e..1a462b0 100644 --- a/src/Endpoint/Index.php +++ b/src/Endpoint/Index.php @@ -146,7 +146,7 @@ class Index $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]])); }