Remove lock when undoing vote

This commit is contained in:
Ajay Ramachandran
2021-07-15 12:32:00 -04:00
parent 3d0b9edb9c
commit d7b8c32c10

View File

@@ -428,7 +428,7 @@ export async function voteOnSponsorTime(req: Request, res: Response): Promise<Re
if (isVIP && incrementAmount > 0 && voteTypeEnum === voteTypes.normal) {
// Unide and Lock this submission
await db.prepare('run', 'UPDATE "sponsorTimes" SET locked = 1, hidden = 0 WHERE "UUID" = ?', [UUID]);
} else if (isVIP && incrementAmount < 0 && voteTypeEnum === voteTypes.normal) {
} else if (isVIP && incrementAmount <= 0 && voteTypeEnum === voteTypes.normal) {
// Unlock if a VIP downvotes it
await db.prepare('run', 'UPDATE "sponsorTimes" SET locked = 0 WHERE "UUID" = ?', [UUID]);
}