kpagacz/wiki-on-fire

Set limit and offset, check total number of articles stored in database

Opened this issue · 0 comments

We need to determine how many articles are currently stored in the database (a simple query will be needed).
Set the number of articles per page (value 'limit') and the value 'offset' which is the number of data to skip.

(final number of pages = total number of articles / limit) <-- round this number up (always!)

Moreover, we want to store information about which page is currently displayed to know which articles should be displayed on it.

Useful links:
https://www.bezkoder.com/node-js-sequelize-pagination-mysql/
https://softwareontheroad.com/pagination-in-nodejs-mongo/