login con carrrera
This commit is contained in:
@@ -92,7 +92,7 @@ const historial = async (body) => {
|
||||
'regresoInmediato',
|
||||
'createdAt',
|
||||
],
|
||||
order: [['idPrestamo', 'ASC']],
|
||||
order: [['idPrestamo', 'DESC']],
|
||||
limit: 25,
|
||||
offset: 25 * (pagina - 1),
|
||||
});
|
||||
|
||||
@@ -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'],
|
||||
});
|
||||
})
|
||||
|
||||
Reference in New Issue
Block a user