Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- router.route("/update/:id").post(function(req, res) {
- User.findById(req.params.id, function(err, user) {
- if (!user) res.status(404).send("user is not found");
- else firstName: req.body.firstName;
- lastName: req.body.lastName;
- email: req.body.email;
- password: req.body.password;
- user
- .save()
- .then(user => {
- res.json("User updated");
- })
- .catch(err => {
- res.status(400).send("User Update not possible");
- });
- });
- });
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement