Kindly wait a moment, post will be visible in just 5 seconds.

No Preview

kyawmyo hlaing

Posted on 10 December 2020

Product Delete Issue

Ad Banner
No Preview

After clicked delete button, automatically route to signin page

0

74

0

No Preview

kyawmyo hlaing

Explore more similar Post

2 Comments

Nabil ALLAM

14 December 2020

The same Problem ! when i try to get req the body is empty i'dont know whey ! how can i put the product checked in the payload ? exports.deleteProductById = (req, res) => { console.log({ body: req }); const { productId } = req.body.payload; console.log({ productId }); if (productId) { Product.deleteOne({ _id: productId }).exec((error, result) => { if (error) return res.status(400).json({ error }); if (result) { res.status(202).json({ result }); } }); } else { res.status(400).json({ error: "Params required" }); } };

0
REPLY

Rizwan Khan

13 December 2020

Please pull the latest code to make it work

1
REPLY