Skip to content

Commit

Permalink
fix backwoards compatibily with deprected Method getAll() - dont skip…
Browse files Browse the repository at this point in the history
… error pages, return them instead
  • Loading branch information
Sysix committed Feb 10, 2024
1 parent 64d558c commit 0aee937
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion src/PaginationClient.php
Original file line number Diff line number Diff line change
Expand Up @@ -62,11 +62,16 @@ public function getAll(): ResponseInterface
// update content to get all contacts
for ($i = 1; $i < $result->totalPages; $i++) {
$responsePage = $this->getPage($i);

if ($responsePage->getStatusCode() !== 200) {
return $responsePage;
}

/** @var ?stdClass{totalPages:int, content:stdClass[]} $resultPage */
$resultPage = Utils::getJsonFromResponse($responsePage);

if ($resultPage === null) {
continue;
return $responsePage;
}

foreach ($resultPage->content as $entity) {
Expand Down

0 comments on commit 0aee937

Please sign in to comment.