Skip to content

Commit

Permalink
Update users_routes.js
Browse files Browse the repository at this point in the history
  • Loading branch information
suneelmeesalameher committed Oct 25, 2023
1 parent d20eddd commit d18de2d
Showing 1 changed file with 12 additions and 1 deletion.
13 changes: 12 additions & 1 deletion routes/users_routes.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,18 @@ router.get("/", async (req, res) => {
}
});

/*Create users */
/* GET search users. */
//give emailId here
router.get("/:emailId", async (req, res) => {
try {
const Users = await User.find({ emailId: { $regex: req.params.emailId } });
res.json(Users);
} catch (err) {
res.status(500).json({ message: err.message });
}
});

/*POST Create users */
router.post("/", async (req, res) => {
const users = await User({
userId: uuid.v1(),
Expand Down

0 comments on commit d18de2d

Please sign in to comment.