Skip to content

Commit

Permalink
Fix pagination issue
Browse files Browse the repository at this point in the history
  • Loading branch information
craigpotter committed Oct 21, 2023
1 parent 58e9291 commit 5ee6cce
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
3 changes: 2 additions & 1 deletion src/Fca.php
Original file line number Diff line number Diff line change
Expand Up @@ -113,7 +113,8 @@ protected function isLastPage(Response $response): bool
*/
protected function getPageItems(Response $response, Request $request): array
{
return $request->createDtoFromResponse($response);
$items = $request->createDtoFromResponse($response);
return $items ?? $response->json('Data', []);
}

/**
Expand Down
3 changes: 2 additions & 1 deletion src/Requests/GetEndpoint.php
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,9 @@

use Saloon\Enums\Method;
use Saloon\Http\Request;
use Saloon\PaginationPlugin\Contracts\Paginatable;

class GetEndpoint extends Request
class GetEndpoint extends Request implements Paginatable
{
/**
* The HTTP method of the request.
Expand Down

0 comments on commit 5ee6cce

Please sign in to comment.