@ -106,7 +106,10 @@ exports.searchProducts = async (req, res) => {
try {
const { productName } = req.body;
const products = await Product.find({ name: { $regex: new RegExp(productName, 'i') } });
const products = await Product.find({
name: { $regex: new RegExp(productName, 'i') },
isActive: true
});
res.json({products});
} catch (error) {