diff --git a/routes/polls.js b/routes/polls.js index 3190d8a2..6090627f 100644 --- a/routes/polls.js +++ b/routes/polls.js @@ -5,7 +5,7 @@ const dbh = require('../database/handler'); // Route for opening poll or poll list router.get('/', async (req, res) => { if (!req.loggedIn) return res.loginRedirect(req, res); - const pollId = req.query.pollId; + const pollId = req.query.id; const activePolls = await dbh.getActivePolls(); if (!pollId) return res.renderFile('poll_list.njk', { activePolls, diff --git a/templates/poll_list.njk b/templates/poll_list.njk index fa9fff1b..853c94e9 100644 --- a/templates/poll_list.njk +++ b/templates/poll_list.njk @@ -18,7 +18,7 @@
{{ poll.title }}
- +
diff --git a/templates/poll_vote.njk b/templates/poll_vote.njk index 85ccde9a..4207530c 100644 --- a/templates/poll_vote.njk +++ b/templates/poll_vote.njk @@ -53,7 +53,7 @@ setTimeout(function () {e.classList.add('hidden')}, 2000); if (response.success) { setTimeout(function () { - window.location.href = "/polls/results/{{ poll._id }}"; + window.location.href = "/polls/results?id={{ poll._id }}"; }, 3000); } }