From 858857cc2e070d4d5a9b5dac85acd1445fa123e4 Mon Sep 17 00:00:00 2001 From: Liam <67254223+RealFascinated@users.noreply.github.com> Date: Thu, 20 Oct 2022 18:16:21 +0100 Subject: [PATCH] Fix star rating issue --- pages/api/beatleader/stars.js | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/pages/api/beatleader/stars.js b/pages/api/beatleader/stars.js index dea90e1..c676462 100644 --- a/pages/api/beatleader/stars.js +++ b/pages/api/beatleader/stars.js @@ -17,7 +17,9 @@ export default async function handler(req, res) { const exists = await RedisUtils.exists(`${KEY}${mapHash}`); if (exists) { - const data = await RedisUtils.getValue(`${KEY}${mapHash}`); + const data = await RedisUtils.getValue( + `${KEY}-${difficulty}-${characteristic}-${mapHash}` + ); res.setHeader("Cache-Status", "hit"); return res.status(200).json({ @@ -43,7 +45,10 @@ export default async function handler(req, res) { }); } const json = await data.json(); - RedisUtils.setValue(`${KEY}${mapHash}`, json.difficulty.stars); + RedisUtils.setValue( + `${KEY}-${difficulty}-${characteristic}-${mapHash}`, + json.difficulty.stars + ); res.setHeader("Cache-Status", "miss"); return res.status(200).json({ status: "OK",