From 448f455186ee695ce0c70574db4fe2b431ad6c55 Mon Sep 17 00:00:00 2001 From: LarsVomMars Date: Thu, 21 Jan 2021 12:48:36 +0100 Subject: FIXERINIO --- mottovote/index.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'mottovote/index.js') diff --git a/mottovote/index.js b/mottovote/index.js index 73c1641..9ef3d62 100644 --- a/mottovote/index.js +++ b/mottovote/index.js @@ -11,7 +11,7 @@ app.get("/api/list", checkUser, async (req, res) => { for (const vote of votes) { const mid = mottos.findIndex((motto) => motto.id === vote.motto_id); - if (mid !== undefined) mottos[mid].votes = vote.votes; + if (mid >= 0) mottos[mid].votes = vote.votes; } res.json(mottos); }); -- cgit v1.2.3