From 1d071bbe317121b5362e8d91cbaf021f0927117c Mon Sep 17 00:00:00 2001 From: Lemuel Marquez Date: Wed, 23 Jun 2021 14:20:29 -0500 Subject: [PATCH] ordenar --- server/controller/Prestamo/activos.js | 1 + server/controller/Prestamo/historial.js | 2 +- server/controller/Prestamo/historialEquipo.js | 1 + server/controller/Prestamo/historialUsuario.js | 1 + 4 files changed, 4 insertions(+), 1 deletion(-) diff --git a/server/controller/Prestamo/activos.js b/server/controller/Prestamo/activos.js index 0573811..f5e2f47 100644 --- a/server/controller/Prestamo/activos.js +++ b/server/controller/Prestamo/activos.js @@ -52,6 +52,7 @@ const activos = async (body) => { ], limit: 25, offset: 25 * (pagina - 1), + order: [['createdAt', 'DESC']], }); }) .then((res) => { diff --git a/server/controller/Prestamo/historial.js b/server/controller/Prestamo/historial.js index 78f854e..93793ea 100644 --- a/server/controller/Prestamo/historial.js +++ b/server/controller/Prestamo/historial.js @@ -58,7 +58,7 @@ const historial = async (body) => { ], limit: 25, offset: 25 * (pagina - 1), - // order: [['createdAt', 'DESC']], + order: [['createdAt', 'DESC']], }).then((res) => { for (let i = 0; i < res.rows.length; i++) { delete res.rows[i].dataValues.idUsuario; diff --git a/server/controller/Prestamo/historialEquipo.js b/server/controller/Prestamo/historialEquipo.js index 33f0f91..7e42de5 100644 --- a/server/controller/Prestamo/historialEquipo.js +++ b/server/controller/Prestamo/historialEquipo.js @@ -20,6 +20,7 @@ const historialEquipo = async (body) => { ], limit: 25, offset: 25 * (pagina - 1), + order: [['createdAt', 'DESC']], }).then((res) => { for (let i = 0; i < res.rows.length; i++) { delete res.rows[i].dataValues.idUsuario; diff --git a/server/controller/Prestamo/historialUsuario.js b/server/controller/Prestamo/historialUsuario.js index 22808a9..be3e9a3 100644 --- a/server/controller/Prestamo/historialUsuario.js +++ b/server/controller/Prestamo/historialUsuario.js @@ -31,6 +31,7 @@ const historialUsuario = async (body) => { ], limit: 25, offset: 25 * (pagina - 1), + order: [['createdAt', 'DESC']], }).then((res) => { for (let i = 0; i < res.rows.length; i++) { delete res.rows[i].dataValues.idOperadorEntrega;