Skip to content

Commit

Permalink
Merge pull request #7 from craigpotter/fix/endpoint-resource
Browse files Browse the repository at this point in the history
Fix | Endpoint Pagination Issue
  • Loading branch information
craigpotter committed Oct 21, 2023
2 parents 58e9291 + 94c68e8 commit 20f76bb
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 2 deletions.
4 changes: 3 additions & 1 deletion src/Fca.php
Original file line number Diff line number Diff line change
Expand Up @@ -113,7 +113,9 @@ 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 20f76bb

Please sign in to comment.