sort tables ok

This commit is contained in:
2021-06-15 19:36:51 -05:00
parent 6dbb3c80c5
commit 14f9937d93
11 changed files with 109 additions and 85 deletions

View File

@@ -5,7 +5,13 @@ const { checkAuth } = require("../middlewares/authentication");
router.get("/ingreso", checkAuth, async (req, res) => {
var Ingresos;
Ingresos = await Ingreso.find({ user: req.userData._id }).sort({
let miFiltro = req.get('filtro');
const filtros = {
fecha: { $regex: miFiltro, $options: "i" },
};
Ingresos = await Ingreso.find({$and:[{ user: req.userData._id },filtros]}).sort({
fecha: "desc",
});