Added stolen functionality

This commit is contained in:
Kasper Rynning-Tønnesen
2020-02-07 15:58:08 +01:00
parent e521218582
commit c282f96b65
5 changed files with 38 additions and 21 deletions

View File

@@ -55,6 +55,9 @@ router.route("/log").post(async (req, res) => {
const yellow = purchaseBody.yellow;
const green = purchaseBody.green;
const bought = purchaseBody.bought;
const stolen = purchaseBody.stolen;
const winesThisDate = [];
for (let i = 0; i < winnersBody.length; i++) {
@@ -111,7 +114,9 @@ router.route("/log").post(async (req, res) => {
yellow: yellow,
red: red,
green: green,
wines: winesThisDate
wines: winesThisDate,
bought: bought,
stolen: stolen
});
await purchase.save();