manejo de usuarios

This commit is contained in:
2022-04-19 20:43:49 -05:00
parent a55f45cafd
commit 153f2da1f7
21 changed files with 922 additions and 56 deletions

View File

@@ -22,7 +22,7 @@ router.get("/categoria", checkAuth, async (req, res) => {
const {name, icon} = req.body;
const user= req.userData._id;
var categoria = await Categoria.findOne({ name: name });
var categoria = await Categoria.findOne({ name: name,user:user });
if (categoria) {
return res.status(500).json({ status: "fail", error: "Categoria existente" });
@@ -61,4 +61,4 @@ router.get("/categoria", checkAuth, async (req, res) => {
});
module.exports = router;
module.exports = router;