Get prizes only returns wines without a winner already.
This commit is contained in:
@@ -39,10 +39,13 @@ const getPrizesForWinnerById = (req, res) => {
|
|||||||
|
|
||||||
return prizeDistribution
|
return prizeDistribution
|
||||||
.verifyWinnerNextInLine(id)
|
.verifyWinnerNextInLine(id)
|
||||||
.then(_ => lottery.allWines())
|
.then(winner => {
|
||||||
.then(wines =>
|
return prelotteryWineRepository.allWinesWithoutWinner().then(wines => [wines, winner]);
|
||||||
|
})
|
||||||
|
.then(([wines, winner]) =>
|
||||||
res.send({
|
res.send({
|
||||||
wines: wines,
|
wines: wines,
|
||||||
|
winner: winner,
|
||||||
message: "Wines to select from",
|
message: "Wines to select from",
|
||||||
success: true
|
success: true
|
||||||
})
|
})
|
||||||
|
|||||||
Reference in New Issue
Block a user