Skip to content

Commit

Permalink
fix: handle unhandled promise rejection in basket items
Browse files Browse the repository at this point in the history
Signed-off-by: omerlh <[email protected]>
  • Loading branch information
omerlh committed May 4, 2021
1 parent ed97c21 commit c12c979
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion routes/basketItems.ts
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,9 @@ module.exports.addBasketItem = function addBasketItem () {

module.exports.quantityCheckBeforeBasketItemAddition = function quantityCheckBeforeBasketItemAddition () {
return (req, res, next) => {
void quantityCheck(req, res, next, req.body.ProductId, req.body.quantity)
void quantityCheck(req, res, next, req.body.ProductId, req.body.quantity).catch(error => {
next(error)
})
}
}

Expand Down

0 comments on commit c12c979

Please sign in to comment.