0
0
Fork 0

refactor to use the new db schema

This commit is contained in:
Oliver-Akins 2021-08-28 22:58:27 -06:00
parent cfb09349c9
commit 79418dcf32
2 changed files with 2 additions and 2 deletions

View file

@ -6,7 +6,7 @@ export async function countVotes(data: any): Promise<object> {
let response = `Quote Votes:`; let response = `Quote Votes:`;
for (var i in db[gID].bracket.quotes) { for (var i in db[gID].bracket.quotes) {
response += `\n${db[gID].bracket.votes[i] ?? 0} votes for \`${db[gID].bracket.quotes[i]}\``; response += `\n${db[gID].bracket.quotes[i].votes} votes for \`${db[gID].bracket.quotes[i]}\``;
}; };
return { return {
type: 4, type: 4,

View file

@ -18,7 +18,7 @@ export async function deleteVote(data: any): Promise<object> {
// Subtract user's vote from total // Subtract user's vote from total
let vote = db[gID].bracket.users[userID]; let vote = db[gID].bracket.users[userID];
--db[gID].bracket.votes[vote]; --db[gID].bracket.quotes[vote].votes;
delete db[gID].bracket.users[userID]; delete db[gID].bracket.users[userID];