change get users

This commit is contained in:
Priyatham Sai Chand 2021-04-26 17:48:24 +05:30
parent 9a24af851d
commit c3d665d62e
No known key found for this signature in database
GPG key ID: 4CB4C85E75F5A80C

View file

@ -107,10 +107,12 @@ router.post("/tokenIsValid", async (req, res) => {
router.get("/", auth, async (req, res) => {
const user = await User.findById(req.user);
console.log(user);
res.json({
username: user.username,
id: user._id,
pricing: user.pricing,
email: user.email,
phonenumber: user.phonenumber
});
});
router.put("/update", async (req, res) => {