From 439191008a5e2180fc1061ee776ec2a2e86a2609 Mon Sep 17 00:00:00 2001 From: KevinMidboe Date: Sun, 11 Oct 2020 22:18:59 +0200 Subject: [PATCH] More logging to console during draw. --- api/virtualRegistration.js | 3 +++ 1 file changed, 3 insertions(+) diff --git a/api/virtualRegistration.js b/api/virtualRegistration.js index 533dd1d..8cf204e 100644 --- a/api/virtualRegistration.js +++ b/api/virtualRegistration.js @@ -117,10 +117,13 @@ const findAndNotifyNextWinner = async () => { let winesLeft = await PreLotteryWine.find(); if (winnersLeft.length > 1) { + console.log("multiple winners left, choose next in line") nextWinner = winnersLeft[0]; // multiple winners left, choose next in line } else if (winnersLeft.length == 1 && winesLeft.length > 1) { + console.log("one winner left, but multiple wines") nextWinner = winnersLeft[0] // one winner left, but multiple wines } else if (winnersLeft.length == 1 && winesLeft.length == 1) { + console.log("one winner and one wine left, choose for user") nextWinner = winnersLeft[0] // one winner and one wine left, choose for user wine = winesLeft[0] return chooseLastWineForUser(nextWinner, wine);