login con carrrera

This commit is contained in:
2022-03-08 12:35:08 -06:00
parent f303e5c869
commit 1137eb5d91
2 changed files with 3 additions and 2 deletions
+1 -1
View File
@@ -92,7 +92,7 @@ const historial = async (body) => {
'regresoInmediato',
'createdAt',
],
order: [['idPrestamo', 'ASC']],
order: [['idPrestamo', 'DESC']],
limit: 25,
offset: 25 * (pagina - 1),
});
+2 -1
View File
@@ -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'],
});
})