fixed user controller

This commit is contained in:
ak 2023-09-29 16:26:41 -07:00
parent e881f3a6ba
commit 8e1f4a2b08

View file

@ -44,7 +44,8 @@ exports.post = [
password: await bcrypt.hash(password, 10), password: await bcrypt.hash(password, 10),
}); });
await User.findByIdAndUpdate(dbUser._id, user, {}); // save to DB
await user.save();
return res.status(200).json({ return res.status(200).json({
message: "User created!", message: "User created!",