From 6debf79cdfd984aab53f324d476773ff827c9310 Mon Sep 17 00:00:00 2001 From: patrickjieraldjuan Date: Sun, 28 Jan 2024 19:41:37 +0800 Subject: [PATCH] Updated responses for updateProduct controller --- controllers/productControllers.js | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/controllers/productControllers.js b/controllers/productControllers.js index bcda3e1..a4a6567 100644 --- a/controllers/productControllers.js +++ b/controllers/productControllers.js @@ -103,13 +103,13 @@ exports.updateProduct = async (req, res) => { }, { new: true }); if (!product) { - return res.status(404).json({ message: 'Product not found' }); + return res.status(404).json(false); } - res.json({ message: 'Product updated successfully', product }); + res.json(true); } catch (error) { console.error(error); - res.status(500).json({ message: 'Error updating product' }); + res.status(500).json(false); } };