From 1f5fbac8fb0a75be7bde33c50818452d91fe781c Mon Sep 17 00:00:00 2001 From: LarsVomMars Date: Wed, 11 Nov 2020 14:24:16 +0100 Subject: Run-off motto vote --- mottovote/index.js | 2 +- mottovote/public/index.html | 6 +++--- mottovote/public/script.js | 2 +- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/mottovote/index.js b/mottovote/index.js index c3dbb9b..73c1641 100644 --- a/mottovote/index.js +++ b/mottovote/index.js @@ -19,7 +19,7 @@ app.get("/api/list", checkUser, async (req, res) => { app.put("/api/vote", checkUser, async (req, res) => { await db.query("DELETE FROM motto_votes WHERE user_id = ?", [req.session.uid]); try { - if (Object.keys(req.body).length > 3) return res.send("error"); + if (Object.keys(req.body).length > 1) return res.send("error"); for (const mid in req.body) { await db.query("INSERT INTO motto_votes (user_id, motto_id, votes) VALUES (?, ?, ?)", [ req.session.uid, diff --git a/mottovote/public/index.html b/mottovote/public/index.html index 5aaa484..321433a 100644 --- a/mottovote/public/index.html +++ b/mottovote/public/index.html @@ -21,9 +21,9 @@ <main> <p> - Genaue Ausführungen, sowie Rechtschreibung, Gestaltung und Sub-Themen sind noch nach der Abstimmung - diskutierbar. Ihr habt drei Stimmen, könnt euch nach der Wahl aber nochmal umentscheiden (ebenfalls über - diese Seite). Bitte wählt vernünftig! + Da das Ergebnis recht knapp war, folgt hier noch eine kurze Stichwahl der beiden Top-Themen. Bitte wählt + vernünftig! Genaue Ausführungen, sowie Rechtschreibung, Gestaltung und Sub-Themen sind noch + diskutierbar. </p> <div id="vote"></div> <button class="pure-button pure-button-primary" id="voteButton">Vote!</button> diff --git a/mottovote/public/script.js b/mottovote/public/script.js index 2a9f602..8e5e392 100644 --- a/mottovote/public/script.js +++ b/mottovote/public/script.js @@ -1,4 +1,4 @@ -const maxVotes = 3; +const maxVotes = 1; get(); async function get() { -- cgit v1.2.3