Verify old submissions right after someone votes on it

This commit is contained in:
Ajay 2024-08-16 00:36:42 -04:00
parent 59373cf346
commit 803fc18554

View file

@ -253,6 +253,13 @@ async function updateVoteTotals(type: BrandingType, UUID: BrandingUUID, userID:
}
} else {
await db.prepare("run", `UPDATE ${table} SET "votes" = "votes" + 1 WHERE "UUID" = ?`, [UUID]);
if (type === BrandingType.Title) {
const votedSubmitterUserID = (await db.prepare("get", `SELECT "userID" FROM ${table2} WHERE "UUID" = ?`, [UUID]))?.userID;
if (votedSubmitterUserID) {
await verifyOldSubmissions(votedSubmitterUserID, await getVerificationValue(votedSubmitterUserID, await isUserVIP(votedSubmitterUserID)));
}
}
}
if (shouldLock) {