From 567932e91e3c0de5323ba15765c8530f36da680d Mon Sep 17 00:00:00 2001 From: Beppe Date: Thu, 28 Feb 2019 21:03:21 +0100 Subject: [PATCH] HELP --- index.js | 2 +- views/layouts/main.handlebars | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/index.js b/index.js index 85168d5..61f63bf 100644 --- a/index.js +++ b/index.js @@ -54,7 +54,7 @@ app.post('/search', (req, res) => { temp = client.db().collection("questions").find(query).toArray(function(err, data) { arr = splice(data) page = 0 + parseInt(req.body.page, 10) - res.render('index', {data: arr[page],page:page,maxpages:arr.length()}) + res.render('index', {data: arr[page],page:page,pagenums:Array.from(new Array(arr.length()), (x,i) => i),maxpages:arr.length()}) client.close() }) }); diff --git a/views/layouts/main.handlebars b/views/layouts/main.handlebars index d6d9c4b..1e67028 100644 --- a/views/layouts/main.handlebars +++ b/views/layouts/main.handlebars @@ -32,6 +32,7 @@
+