Save userid with votes

This commit is contained in:
Ajay
2022-03-30 16:02:30 -04:00
parent 9bcf7ed199
commit fe0afd58bc
3 changed files with 16 additions and 3 deletions

View File

@@ -490,7 +490,7 @@ export async function vote(ip: IPAddress, UUID: SegmentUUID, paramUserID: UserID
if (votesRow) {
await privateDB.prepare("run", `UPDATE "votes" SET "type" = ? WHERE "userID" = ? AND "UUID" = ?`, [type, userID, UUID]);
} else {
await privateDB.prepare("run", `INSERT INTO "votes" VALUES(?, ?, ?, ?)`, [UUID, userID, hashedIP, type]);
await privateDB.prepare("run", `INSERT INTO "votes" VALUES(?, ?, ?, ?, ?)`, [UUID, userID, hashedIP, type, nonAnonUserID]);
}
// update the vote count on this sponsorTime