Skip to content

Instantly share code, notes, and snippets.

@sm-a
Created July 24, 2019 08:38
Show Gist options
  • Save sm-a/25bdcc3f9138eb27f92004ff616930d0 to your computer and use it in GitHub Desktop.
Save sm-a/25bdcc3f9138eb27f92004ff616930d0 to your computer and use it in GitHub Desktop.
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