mirror of
https://github.com/yusufipk/RememberMe.git
synced 2026-09-11 10:56:07 +00:00
created(tests) created tests for person route
This commit is contained in:
+2
-2
@@ -18,8 +18,8 @@ router.get("/:id", auth, validateObjectId, async (req, res) => {
|
||||
});
|
||||
|
||||
router.get("/get/:name", auth, async (req, res) => {
|
||||
const p = new RegExp(req.params.name, "i");
|
||||
const person = await Person.find({ name: p });
|
||||
const findName = new RegExp(req.params.name, "i");
|
||||
const person = await Person.find({ name: findName });
|
||||
if (person.length === 0)
|
||||
return res.status(404).send("Person does not exist!");
|
||||
|
||||
|
||||
Reference in New Issue
Block a user