Syntax error w/ capitalization crashes draw!

This commit is contained in:
2020-10-11 22:18:37 +02:00
committed by KevinMidboe
parent 432d9211b2
commit 795f110e1b

View File

@@ -95,15 +95,19 @@ const registerWinnerSelection = async (req, res) => {
})) }))
}; };
const chooseLastWineForUser = (winner, prelotteryWine) => { const chooseLastWineForUser = (winner, preLotteryWine) => {
let date = new Date(); let date = new Date();
date.setHours(5, 0, 0, 0); date.setHours(5, 0, 0, 0);
return _wineFunctions.findSaveWine(preLotteryWine) return _wineFunctions.findSaveWine(preLotteryWine)
.then(wonWine => _personFunctions.findSavePerson(winner, wonWine, date)) .then(wonWine => _personFunctions.findSavePerson(winner, wonWine, date))
.then(() => prelotteryWine.delete()) .then(() => preLotteryWine.delete())
.then(() => Message.sendLastWinnerMessage(winner, preLotteryWine)) .then(() => Message.sendLastWinnerMessage(winner, preLotteryWine))
.then(() => winner.delete()); .then(() => winner.delete())
.catch(err => {
console.log("Error thrown from chooseLastWineForUser: " + err);
throw err;
})
} }
const findAndNotifyNextWinner = async () => { const findAndNotifyNextWinner = async () => {