fix(medusa): Send INSUFFICIENT_INVENTORY code with error (#5265)

This commit is contained in:
chemicalkosek
2023-10-05 00:41:48 +02:00
committed by GitHub
parent a9703bd370
commit ea8d9e30e7

View File

@@ -1042,7 +1042,8 @@ class CartService extends TransactionBaseService {
if (!hasInventory) {
throw new MedusaError(
MedusaError.Types.NOT_ALLOWED,
"Inventory doesn't cover the desired quantity"
"Inventory doesn't cover the desired quantity",
MedusaError.Codes.INSUFFICIENT_INVENTORY
)
}