sahilLikes2Code / node7

0 stars 0 forks source link

use async await #1

Open puneettiwari61 opened 4 years ago

puneettiwari61 commented 4 years ago

router.put("/update/:id", async (req, res) => { try { var updateUser = await User.findByIdAndUpdate(req.params.id, req.body, { new: true }); res.json({ updateUser }); } catch (err) { console.log(err); res.json({ err }); } });

sahilLikes2Code commented 4 years ago

ok, thanks for your feedback. Highly appreciate it💪