From 232180bb1e164721875feb31c6dd089717601bdf Mon Sep 17 00:00:00 2001 From: patrickjieraldjuan Date: Sun, 28 Jan 2024 23:10:01 +0800 Subject: [PATCH] Updated code for createProduct controller --- controllers/productControllers.js | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/controllers/productControllers.js b/controllers/productControllers.js index ac29772..ef0445b 100644 --- a/controllers/productControllers.js +++ b/controllers/productControllers.js @@ -17,16 +17,16 @@ module.exports.createProduct = async (req, res) => { name, price, description, - inventory, + inventory }); // Save the product to the database await product.save(); - res.status(201).json({ message: 'Product created successfully', product }); + res.status(201).json(true); } catch (error) { console.error(error); - res.status(500).json({ message: 'Error creating product' }); + res.status(500).json(false); } };