From c3c8f38423261a2b47a5b7ea063291975a53ddc8 Mon Sep 17 00:00:00 2001 From: Ajay Date: Thu, 3 Aug 2023 01:50:50 -0400 Subject: [PATCH] Rename var to be more clear --- src/routes/generateToken.ts | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/src/routes/generateToken.ts b/src/routes/generateToken.ts index 6190ebd..575df4c 100644 --- a/src/routes/generateToken.ts +++ b/src/routes/generateToken.ts @@ -25,10 +25,10 @@ export async function generateTokenRequest(req: GenerateTokenRequest, res: Respo if (type === TokenType.patreon || ([TokenType.local, TokenType.gift].includes(type) && adminUserIDHash === config.adminUserID) || type === TokenType.free) { - const licenseKey = await createAndSaveToken(type, code, adminUserIDHash === config.adminUserID ? parseInt(total) : 1); + const licenseKeys = await createAndSaveToken(type, code, adminUserIDHash === config.adminUserID ? parseInt(total) : 1); /* istanbul ignore else */ - if (licenseKey) { + if (licenseKeys) { if (type === TokenType.patreon) { return res.status(200).send(`

@@ -36,7 +36,7 @@ export async function generateTokenRequest(req: GenerateTokenRequest, res: Respo

- ${licenseKey[0]} + ${licenseKeys[0]}

@@ -45,10 +45,10 @@ export async function generateTokenRequest(req: GenerateTokenRequest, res: Respo `); } else if (type === TokenType.free) { return res.status(200).send({ - licenseKey: licenseKey[0] + licenseKey: licenseKeys[0] }); } else { - return res.status(200).send(licenseKey.join("
")); + return res.status(200).send(licenseKeys.join("
")); } } else { return res.status(401).send(`