Hey guys, I'm currently studying nodejs, and this boilerplate is helping me a great deal. But I got stuck in one thing. See the code below to update an user
function update(req, res, next) {
const user = req.user;
user.username = req.body.username;
user.mobileNumber = req.body.mobileNumber;
user.save()
.then(savedUser => res.json(savedUser))
.catch(e => next(e));
}
Is the client supposed to send the entire user in the request? If not, how is the user embedded in the request?
Hey guys, I'm currently studying nodejs, and this boilerplate is helping me a great deal. But I got stuck in one thing. See the code below to update an user
Is the client supposed to send the entire user in the request? If not, how is the user embedded in the request?