Skip to content

Commit

Permalink
force express checkout failure (#293)
Browse files Browse the repository at this point in the history
  • Loading branch information
cstavitsky authored Oct 16, 2023
1 parent 5a9e084 commit 68da2b9
Showing 1 changed file with 2 additions and 5 deletions.
7 changes: 2 additions & 5 deletions express/server.js
Original file line number Diff line number Diff line change
Expand Up @@ -206,11 +206,8 @@ app.post("/checkout", async (req, res) => {
let quantities = cart["quantities"];
console.log("quantities", quantities);
for (const cartItem in quantities) {
for (const inventoryItem of inventory) {
console.log("> inventoryItem.count", inventoryItem["count"]);
if (!hasInventory(inventoryItem)) {
throw new Error("Not enough inventory for product");
}
if (!hasInventory(cartItem)) {
throw new Error("Not enough inventory for product");
}
}
spanProcessOrder.finish();
Expand Down

0 comments on commit 68da2b9

Please sign in to comment.