aboutsummaryrefslogtreecommitdiff
path: root/mottovote/index.js
diff options
context:
space:
mode:
authorLarsVomMars2021-01-21 12:48:36 +0100
committerLarsVomMars2021-01-21 12:48:36 +0100
commit448f455186ee695ce0c70574db4fe2b431ad6c55 (patch)
tree707a828b1fbb4e10ab4ba0f796690110d39cde1a /mottovote/index.js
parentfa4026fd87b17cc2c69f23da516f7399aae20f67 (diff)
FIXERINIO
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 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);
});