Created
July 24, 2019 08:38
-
-
Save sm-a/25bdcc3f9138eb27f92004ff616930d0 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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