diff --git a/controllers/user.js b/controllers/user.js index 3c22147..98ef22e 100644 --- a/controllers/user.js +++ b/controllers/user.js @@ -44,7 +44,8 @@ exports.post = [ password: await bcrypt.hash(password, 10), }); - await User.findByIdAndUpdate(dbUser._id, user, {}); + // save to DB + await user.save(); return res.status(200).json({ message: "User created!",