Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- let allOrdersUpdate = (req, res) => {
- let newState = req.body.status
- Order.find({}).sort('-date').populate('product').then(orders => {
- for (let elem in newState) {
- orders[elem].status = newState[elem]
- orders[elem].save()
- }
- res.redirect('/allOrders')
- console.log(orders)
- })
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement