aboutsummaryrefslogtreecommitdiff
path: root/mottovote/index.js
diff options
context:
space:
mode:
Diffstat (limited to 'mottovote/index.js')
-rw-r--r--mottovote/index.js2
1 files changed, 1 insertions, 1 deletions
diff --git a/mottovote/index.js b/mottovote/index.js
index d22ba29..df1f6a4 100644
--- a/mottovote/index.js
+++ b/mottovote/index.js
@@ -20,7 +20,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 (req.body.entries().length > 3) return res.send("error");
+ if (Object.keys(req.body).length > 3) return res.send("error");
for (const mid in req.body) {
await db.query(
"INSERT INTO motto_votes (user_id, motto_id, votes) VALUES (?, ?, ?)",