From 1137eb5d9130131dc65ff2a8d58ade5b1ccd9ae6 Mon Sep 17 00:00:00 2001 From: lemuel Date: Tue, 8 Mar 2022 12:35:08 -0600 Subject: [PATCH] login con carrrera --- server/controller/Prestamo/historial.js | 2 +- server/controller/Usuario/login.js | 3 ++- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/server/controller/Prestamo/historial.js b/server/controller/Prestamo/historial.js index 0f24942..e91a06f 100644 --- a/server/controller/Prestamo/historial.js +++ b/server/controller/Prestamo/historial.js @@ -92,7 +92,7 @@ const historial = async (body) => { 'regresoInmediato', 'createdAt', ], - order: [['idPrestamo', 'ASC']], + order: [['idPrestamo', 'DESC']], limit: 25, offset: 25 * (pagina - 1), }); diff --git a/server/controller/Usuario/login.js b/server/controller/Usuario/login.js index c8ef656..2f1a37f 100644 --- a/server/controller/Usuario/login.js +++ b/server/controller/Usuario/login.js @@ -4,6 +4,7 @@ const helperPath = '../../helper'; const { comparar } = require(`${helperPath}/encriptar`); const validar = require(`${helperPath}/validar`); const dbPath = '../../db/tablas'; +const Carrera = require(`${dbPath}/Carrera`); const Usuario = require(`${dbPath}/Usuario`); const TipoUsuario = require(`${dbPath}/TipoUsuario`); @@ -27,7 +28,7 @@ const login = async (body) => { throw new Error('La contraseƱa es incorrecta.'); return Usuario.findOne({ where: { usuario }, - include: [{ model: TipoUsuario }], + include: [{ model: TipoUsuario }, { model: Carrera }], attributes: ['idUsuario', 'usuario', 'nombre', 'multa', 'activo'], }); })