traer a todos los responsables

This commit is contained in:
2020-11-19 12:23:39 -06:00
parent 9b748bc130
commit d5271cd086
5 changed files with 63 additions and 4 deletions
-2
View File
@@ -40,9 +40,7 @@ const admin = (body) => {
Usuario: {
idUsuario: res.Usuario.idUsuario,
usuario: res.Usuario.usuario,
password: res.Usuario.password,
nombre: res.Usuario.nombre,
activo: res.Usuario.activo,
TipoUsuario: {
idTipoUsuario: res.Usuario.TipoUsuario.idTipoUsuario,
tipoUsuario: res.Usuario.TipoUsuario.tipoUsuario,
+1 -1
View File
@@ -22,7 +22,7 @@ const serviciosAdmin = async (body) => {
return Usuario.findOne({ where: { idUsuario } })
.then((res) => {
if (!res) throw new Error('No existe este usuario.');
if (res.idTipoUsuario != 1)
if (res.idTipoUsuario !== 1)
throw new Error('No es un usuario tipo admin.');
return Servicio.findAll({
where,
@@ -23,7 +23,7 @@ const serviciosResponsable = async (body) => {
return Usuario.findOne({ where: { idUsuario } })
.then((res) => {
if (!res) throw new Error('No existe este usuario.');
if (res.idTipoUsuario != 2)
if (res.idTipoUsuario !== 2)
throw new Error('No es un usuario tipo responsable.');
return Servicio.findAll({
where,