What might be the problem? Here is my post request
router.post("/users", async (req, res) => {
const user = new User(req.body);
try {
await user.save()
//sendWelcomeEmail(user.email,user.name)
const token = await user.generateAuthToken()
res.status(201).send({user:user,token:token});
} catch (e) {
res.status(400).send(e);
}
});
The following is my client postman view for the post request
The collection is created and i can view it in robo3t.The issue is that my post request is returning an empty object as seen in the above image