asc and desc
This commit is contained in:
@@ -6,13 +6,15 @@ const { validarNumeroEntero } = require('../../helper/validar');
|
||||
|
||||
const todasInscripciones = async (body) => {
|
||||
const validacion = validarNumeroEntero(body.validacion, 'validacion', true);
|
||||
const order = validacion === 2 ? [['idInscripcion', 'ASC']] : [['idInscripcion', 'DESC']];
|
||||
console.log(order)
|
||||
return Inscripcion.findAll({
|
||||
where: {
|
||||
validacion,
|
||||
cancelacion: 0,
|
||||
idPeriodo: Number(process.env.PERIODO),
|
||||
},
|
||||
order: [['idInscripcion', 'DESC']],
|
||||
order: order,
|
||||
include: [
|
||||
{
|
||||
model: Usuario,
|
||||
|
||||
Reference in New Issue
Block a user