Skip to content

Instantly share code, notes, and snippets.

@sm-a
Last active July 23, 2019 20:14
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save sm-a/23b4f2c06fd499ccafabcd96fc8b1435 to your computer and use it in GitHub Desktop.
Save sm-a/23b4f2c06fd499ccafabcd96fc8b1435 to your computer and use it in GitHub Desktop.
Cats.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
Detail.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