From d4270c4e7089dc0df44e16a48870a3c446c20a01 Mon Sep 17 00:00:00 2001 From: beppe Date: Thu, 28 Feb 2019 20:24:24 +0000 Subject: [PATCH] YES --- index.js | 2 +- views/index.handlebars | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/index.js b/index.js index 9f27e9f..03b77ec 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', {search:req.body.title, data: arr[page],page:page,pagenums:Array.from(new Array(arr.length), (x,i) => i),maxpages:arr.length}) + res.render('index', {title:req.body.title, data: arr[page],page:page,pagenums:Array.from(new Array(arr.length), (x,i) => i),maxpages:arr.length}) client.close() }) }); diff --git a/views/index.handlebars b/views/index.handlebars index 2a5ec73..c6f6e1b 100644 --- a/views/index.handlebars +++ b/views/index.handlebars @@ -21,10 +21,10 @@
- +
    {{#each this.pagenums}} -
  • {{this}}
  • +
  • {{this}}
  • {{/each}}