linea responsable agregada
This commit is contained in:
@@ -0,0 +1,16 @@
|
||||
const { validarId } = require('../../helper/validar');
|
||||
const Usuario = require('../../db/tablas/Usuario');
|
||||
|
||||
const responsable = async (body) => {
|
||||
const idUsuario = validarId(body.idUsuario);
|
||||
|
||||
return Usuario.findOne({
|
||||
where: { idUsuario },
|
||||
}).then((res) => {
|
||||
delete res.dataValues.password;
|
||||
delete res.dataValues.idTipoUsuario;
|
||||
return res;
|
||||
});
|
||||
};
|
||||
|
||||
module.exports = responsable;
|
||||
@@ -13,9 +13,11 @@ const responsables = async (body) => {
|
||||
|
||||
return Usuario.findAndCountAll({
|
||||
where: {
|
||||
usuario: { [Op.like]: `%${correo}%` },
|
||||
nombre: { [Op.like]: `%${nombre}%` },
|
||||
idTipoUsuario: 2,
|
||||
[Op.and]: [
|
||||
{ usuario: { [Op.like]: `%${correo}%` } },
|
||||
{ nombre: { [Op.like]: `%${nombre}%` } },
|
||||
{ idTipoUsuario: 2 },
|
||||
],
|
||||
},
|
||||
limit: 25,
|
||||
offset: 25 * (pagina - 1),
|
||||
|
||||
Reference in New Issue
Block a user