From f3816421b3b85392d9edeff40d6865bc61acc7f9 Mon Sep 17 00:00:00 2001 From: starit Date: Fri, 1 Mar 2024 14:33:52 -0700 Subject: [PATCH] fix --- pages/api/vote.ts | 2 ++ 1 file changed, 2 insertions(+) diff --git a/pages/api/vote.ts b/pages/api/vote.ts index 024341b..23d8afe 100644 --- a/pages/api/vote.ts +++ b/pages/api/vote.ts @@ -58,8 +58,10 @@ export default async function handler(req: NextApiRequest, res: NextApiResponse) let multi = kv.multi(); multi.hincrby(`poll:${pollId}`, `votes${buttonId}`, 1); multi.sadd(`poll:${pollId}:voted`, fid); + multi.sadd(`poll:${pollId}:voted${buttonId}`, fid); multi.expire(`poll:${pollId}`, POLL_EXPIRY); multi.expire(`poll:${pollId}:voted`, POLL_EXPIRY); + multi.expire(`poll:${pollId}:voted${buttonId}`, POLL_EXPIRY); await multi.exec(); }