Bug/51 - Last winner is not automatically receiving the last wine! #52

Merged
KevinMidboe merged 4 commits from bug/51 into master 2020-10-11 20:30:02 +00:00
2 changed files with 7 additions and 3 deletions
Showing only changes of commit e76e814877 - Show all commits

View File

@@ -187,7 +187,10 @@ const drawWinner = async (req, res) => {
);
await newWinnerElement.save();
return res.json(winner);
return res.json({
success: true,
winner
});
};
const finish = async (req, res) => {

View File

@@ -229,7 +229,8 @@ export default {
this.drawingWinner = true;
let response = await getVirtualWinner();
if (response) {
if (response.success) {
console.log("Winner:", response.winner);
if (this.currentWinners < this.numberOfWinners) {
this.countdown();
} else {
@@ -245,7 +246,7 @@ export default {
this.getAttendees();
} else {
this.drawingWinner = false;
alert("Noe gikk galt under trekningen..!");
alert("Noe gikk galt under trekningen..! " + response["message"]);
}
}
},