From e43eba6112ad4c7591899f484f2c8483b83bca85 Mon Sep 17 00:00:00 2001 From: Ahmed Abdien Date: Sat, 11 Nov 2023 08:46:38 +0300 Subject: [PATCH] edit throw error condition --- backend/controllers/orderController.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/backend/controllers/orderController.js b/backend/controllers/orderController.js index eface49c..f8871ae2 100644 --- a/backend/controllers/orderController.js +++ b/backend/controllers/orderController.js @@ -10,7 +10,7 @@ import { verifyPayPalPayment, checkIfNewTransaction } from '../utils/paypal.js'; const addOrderItems = asyncHandler(async (req, res) => { const { orderItems, shippingAddress, paymentMethod } = req.body; - if (orderItems && orderItems.length === 0) { + if (!orderItems && orderItems.length === 0) { res.status(400); throw new Error('No order items'); } else {