summary refs log tree commit diff
diff options
context:
space:
mode:
authorCyberL1 <cyber.hf18@gmail.com>2026-06-25 08:30:13 +0200
committerRory& <root@rory.gay>2026-06-25 17:56:49 +0200
commit68ee917ccfbaa53158232b01d2b4766bacc33b39 (patch)
treeb7730bcacdcddb31757bb086a90d9fc663f25e04
parentfeat: send vote poll events (diff)
downloadserver-ts-68ee917ccfbaa53158232b01d2b4766bacc33b39.tar.xz
fix: don't send loop over not voted answers
-rw-r--r--src/api/routes/channels/#channel_id/polls/#poll_id/answers/@me.ts2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/api/routes/channels/#channel_id/polls/#poll_id/answers/@me.ts b/src/api/routes/channels/#channel_id/polls/#poll_id/answers/@me.ts

index a3594c8e..fc8a436b 100644 --- a/src/api/routes/channels/#channel_id/polls/#poll_id/answers/@me.ts +++ b/src/api/routes/channels/#channel_id/polls/#poll_id/answers/@me.ts
@@ -75,7 +75,7 @@ router.put("/", route({ requestBody: "PollUserAnswersSchema", permission: "VIEW_ } } - for (const answerCount of allAnswerCounts.filter((a) => !payload.answer_ids.includes(a.id))) { + for (const answerCount of allAnswerCounts.filter((a) => !payload.answer_ids.includes(a.id) && a.voters.includes(req.user_id))) { answerCount.voters = answerCount.voters.filter((voter) => voter != req.user_id); answerCount.count = answerCount.voters.length;