Commit 4d693586 authored by Grover Pinto's avatar Grover Pinto

Correccion de sintaxis para el order en la ruta encurso

parent af3b893f
......@@ -806,9 +806,9 @@ module.exports = app => {
if(req.query.limit) opcionesDocumento.limit=req.query.limit;
if(req.query.page) opcionesDocumento.offset=(req.query.limit * ((req.query.page || 1) - 1)) || 0;
if(req.query.order){
const order = (req.query.order.charAt(0)=='-')? ' DESC': '';
const order = (req.query.order.charAt(0)=='-')? 'DESC': '';
req.query.order = (req.query.order.charAt(0)=='-')? req.query.order.substring(1,req.query.order.length) : req.query.order;
opcionesDocumento.order = req.query.order + order;
opcionesDocumento.order = [[req.query.order, order]];
}
opcionesDocumento.where.$or[0].grupo = { $in: xdocs };
opcionesDocumento.where.$or[1].grupo = { $in: xdocs };
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment