Get prizes only returns wines without a winner already.

This commit is contained in:
2021-02-18 20:58:09 +01:00
parent 9fd67a6bc3
commit dcaaeae51f

View File

@@ -39,10 +39,13 @@ const getPrizesForWinnerById = (req, res) => {
return prizeDistribution
.verifyWinnerNextInLine(id)
.then(_ => lottery.allWines())
.then(wines =>
.then(winner => {
return prelotteryWineRepository.allWinesWithoutWinner().then(wines => [wines, winner]);
})
.then(([wines, winner]) =>
res.send({
wines: wines,
winner: winner,
message: "Wines to select from",
success: true
})