From 85560c2421c7e11f406a3eb2b5de92ec6683e230 Mon Sep 17 00:00:00 2001 From: wonderlandpark Date: Wed, 26 May 2021 21:37:00 +0900 Subject: [PATCH] fix: invalid v1 api --- pages/api/v1/bots/voted/{[botID].ts => [id].ts} | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) rename pages/api/v1/bots/voted/{[botID].ts => [id].ts} (89%) diff --git a/pages/api/v1/bots/voted/[botID].ts b/pages/api/v1/bots/voted/[id].ts similarity index 89% rename from pages/api/v1/bots/voted/[botID].ts rename to pages/api/v1/bots/voted/[id].ts index ca19d42..ccfa520 100644 --- a/pages/api/v1/bots/voted/[botID].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 }) - if(req.query.botID !== bot) return ResponseWrapper(res, { code: 403, version: 1 }) + if(req.query.id !== bot) return ResponseWrapper(res, { code: 403, version: 1 }) 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) @@ -21,7 +21,6 @@ interface ApiRequest extends NextApiRequest { token: string } query: { - botID: string id: string } }