Rename var to be more clear

This commit is contained in:
Ajay 2023-08-03 01:50:50 -04:00
parent 1dbb393e4d
commit c3c8f38423

View file

@ -25,10 +25,10 @@ export async function generateTokenRequest(req: GenerateTokenRequest, res: Respo
if (type === TokenType.patreon if (type === TokenType.patreon
|| ([TokenType.local, TokenType.gift].includes(type) && adminUserIDHash === config.adminUserID) || ([TokenType.local, TokenType.gift].includes(type) && adminUserIDHash === config.adminUserID)
|| type === TokenType.free) { || 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 */ /* istanbul ignore else */
if (licenseKey) { if (licenseKeys) {
if (type === TokenType.patreon) { if (type === TokenType.patreon) {
return res.status(200).send(` return res.status(200).send(`
<h1> <h1>
@ -36,7 +36,7 @@ export async function generateTokenRequest(req: GenerateTokenRequest, res: Respo
</h1> </h1>
<p> <p>
<b> <b>
${licenseKey[0]} ${licenseKeys[0]}
</b> </b>
</p> </p>
<p> <p>
@ -45,10 +45,10 @@ export async function generateTokenRequest(req: GenerateTokenRequest, res: Respo
`); `);
} else if (type === TokenType.free) { } else if (type === TokenType.free) {
return res.status(200).send({ return res.status(200).send({
licenseKey: licenseKey[0] licenseKey: licenseKeys[0]
}); });
} else { } else {
return res.status(200).send(licenseKey.join("<br/>")); return res.status(200).send(licenseKeys.join("<br/>"));
} }
} else { } else {
return res.status(401).send(` return res.status(401).send(`