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

Paginate only show first page #46

Closed
maungyehtunzaw opened this issue Aug 2, 2018 · 2 comments
Closed

Paginate only show first page #46

maungyehtunzaw opened this issue Aug 2, 2018 · 2 comments

Comments

@maungyehtunzaw
Copy link

maungyehtunzaw commented Aug 2, 2018

User is show to limit to next page
http://localhost:1500/categories?page=2&limit=4
but the result only show first pages data query..

router.get('/', function(req, res, next) {
  models.Category.findAndCountAll({limit:req.query.limit,offset:req.skip}).then(results=>{
    const itemCount = results.count;
    const pageCount = Math.ceil(results.count / req.query.limit); 
    res.render('categories/list', {
              cats:results.rows,
              pageCount,
              itemCount,
              pages:paginate.getArrayPages(req)(3, pageCount, req.query.page)

            });
        });
});

image

@charan432
Copy link

Hi,

I also have the same issue. Did you resolve the above issue or found any solution??

@niftylettuce
Copy link
Contributor

PR welcome if it is a bug

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