From 70024ae126b9f170ca12432baac682b1f8d5eee0 Mon Sep 17 00:00:00 2001 From: Navaneeth V Date: Thu, 8 Feb 2024 13:10:23 +0530 Subject: [PATCH] product edit bug fixed saleprice is not changing --- controllers/orderContoller.js | 4 ++-- controllers/productController.js | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/controllers/orderContoller.js b/controllers/orderContoller.js index 3217ba0..06cf367 100644 --- a/controllers/orderContoller.js +++ b/controllers/orderContoller.js @@ -106,7 +106,7 @@ const orderPlaced = async (req, res) => { // const findAddress = address.find(item => item._id.toString() === addressId); const findAddress = address.address.find(item => item._id.toString() === addressId); console.log(findAddress); - console.log("Before product search") + // console.log("Before product search") const findProduct = await Product.findOne({ _id: productId }) // console.log(findProduct); @@ -117,7 +117,7 @@ const orderPlaced = async (req, res) => { image: findProduct.productImage[0], quantity: 1 } - console.log("Before order placed") + // console.log("Before order placed") const newOrder = new Order(({ product: productDetails, totalPrice: totalPrice, diff --git a/controllers/productController.js b/controllers/productController.js index 240b2ac..1db0c58 100644 --- a/controllers/productController.js +++ b/controllers/productController.js @@ -120,7 +120,7 @@ const editProduct = async (req, res) => { brand: data.brand, category: data.category, regularPrice: data.regularPrice, - salePrice: data.regularPrice, + quantity: data.quantity, size: data.size, color: data.color, @@ -139,7 +139,7 @@ const editProduct = async (req, res) => { brand: data.brand, category: data.category, regularPrice: data.regularPrice, - salePrice: data.salePrice, + salePrice: data.regularPrice, quantity: data.quantity, size: data.size, color: data.color,