json-server icon indicating copy to clipboard operation
json-server copied to clipboard

Pagination fetches all Objects instead of just one page

Open breathTake opened this issue 1 year ago • 3 comments

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...
]

breathTake avatar Jun 27 '24 10:06 breathTake