From 8fb2bb9eef1fa7ed4b077b27e51c9b7356c6b910 Mon Sep 17 00:00:00 2001 From: wonderlandpark Date: Sat, 29 May 2021 01:00:26 +0900 Subject: [PATCH] fix: api bug --- pages/api/v1/bots/voted/[id].ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pages/api/v1/bots/voted/[id].ts b/pages/api/v1/bots/voted/[id].ts index 659d0bb..28afbfb 100644 --- a/pages/api/v1/bots/voted/[id].ts +++ b/pages/api/v1/bots/voted/[id].ts @@ -9,7 +9,7 @@ const BotVoted = RequestHandler() .get(async (req: ApiRequest, res) => { const bot = await get.BotAuthorization(req.headers.token) if(!bot) return ResponseWrapper(res, { code: 401, version: 1 }) - const userID = await Yup.string().required().validate(bot).then(el => el).catch(() => null) + const userID = await Yup.string().required().validate(req.query.id).then(el => el).catch(() => null) if(!userID) return ResponseWrapper(res, { code: 400, version: 1 }) const result = await get.botVote(userID, bot) return res.json({ code: 200, voted: +new Date() < result + VOTE_COOLDOWN })