Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Bug]: getAllProducts() returns an array instead of a paginated result #6

Open
kevinpapst opened this issue May 18, 2023 · 1 comment
Labels
enhancement New feature or request

Comments

@kevinpapst
Copy link
Contributor

What happened?

The API only returns the first 10 results, see https://docs.lemonsqueezy.com/api#pagination

Instead the API Product::getAllProducts() should return a ProductPage extends PaginatedResult.

Where PaginatedResult is an abstract class with a couple of methods:

  • countPages()
  • nextPage()
  • previousPage()
  • firstPage()
  • lastPage()
  • getResults()

Additionally getAllProducts(PageQuery $query) method should accept a query object with params:

  • pageSize
  • number
  • ...

How to reproduce the bug

See above

Package Version

x

PHP Version

8.2

Which operating systems does with happen with?

macOS

Notes

No response

@kevinpapst kevinpapst added the bug Something isn't working label May 18, 2023
@kevinpapst kevinpapst changed the title [Bug]: getAllProducts() returns a paginated result [Bug]: getAllProducts() returns an array instead of a paginated result May 18, 2023
@ricardov03 ricardov03 added enhancement New feature or request and removed bug Something isn't working labels May 27, 2023
@ricardov03
Copy link
Collaborator

To explain why I changed this from a bug to an enhancement, Pagination was defined in the initial Roadmap, and it's not set as Done. I was expecting to work on this by the end of the development, but as you require this, I will make sure to include this after the discounts.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants