I
I
IDONTSUDO2019-06-16 20:33:19
RESTful API
IDONTSUDO, 2019-06-16 20:33:19

How should pagination work in a SPA application? (REST)?

Let's say my REST API returns 100 objects. Artificial pagination on the front, I can do. I can also do pagination on the back end. But here's how to make the back end give out 100 objects first, then another 100 starting from 101. I don't know, and I don't understand.
It seems to me: You need to pass some parameters, but in the AXIOS / fetch documentation. I can't find it.

Answer the question

In order to leave comments, you need to log in

1 answer(s)
S
Sergey Epifanov, 2019-06-16
@IDONTSUDO

from the front, pass the page number to the back, and on the backend, return the results relative to this number. in MySQL, as far as I remember, there is OFFSET for this

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question