This commit is contained in:
2019-02-28 21:16:30 +01:00
parent 48c52db2e0
commit cb156c626a
2 changed files with 11 additions and 1 deletions

View File

@@ -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,pagenums:Array.from(new Array(arr.length), (x,i) => i),maxpages:arr.length})
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})
client.close()
})
});