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

Pagination fetches all Objects instead of just one page #1565

Open
breathTake opened this issue Jun 27, 2024 · 3 comments
Open

Pagination fetches all Objects instead of just one page #1565

breathTake opened this issue Jun 27, 2024 · 3 comments

Comments

@breathTake
Copy link

For reference using the newest version "1.0.0-beta.1".

Im Fetching from my employee category with http://localhost:3000/employees?_page=1&_per_page=10, but the response gives mit all the employees available in the db.

Or am i understanding its purpose wrong and it is meant to be client side pagination and no serverside pag?

Im Getting this data object:

{
    "first": 1,
    "prev": null,
    "next": 2,
    "last": 850,
    "pages": 850,
    "items": 850,
    "data": [
        850 entries...
      ]

I was expecting to get something like that:

[
   {
        Object1: {...}
   },
   {
        Object1: {...}
   }
   total 10...
]
@abdullateef97
Copy link

@breathTake have you resolved this

@breathTake
Copy link
Author

@breathTake have you resolved this

Yes, I downgraded to the last full release version, but I didn’t worked in this version unfortunately.

-> v0.17.4

@ivanzusko
Copy link

@breathTake, I believe it works as it should.

It returns:

{
   "first": 1,
  "prev": null,
  "next": 2,
  "last": 126,
  "pages": 126,
  "items": 1259,
  "data": ...//10 objects

You receive 10 items (as requested), from the 1st page.
The rest info:
first - first page to show in pagination (eg 1 ... 126)
next - next page to request for pagination (if you click arrow)
last - the last page to show in your pagination (eg < 1 2 3 ... 126)
pages - total amount of pages
items - total amount of items

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

No branches or pull requests

3 participants