Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
Carts.find({ user: req.params.user }, function (err, product) {
if (err) {
return res.send({ isFound: false });
}
if (!product) {
return res.send({ isFound: false });
}
product.forEach(element => {
element.orderid = req.params.smaorderid
OrderD.create(element, function (err, orderitems) {
if (err) {
console.log(err)
return res.send({isCreated: false})
}
})
});
return res.send({isCreated: true})
})
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment