traer a todos los responsables
This commit is contained in:
@@ -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,
|
||||
|
||||
@@ -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,
|
||||
|
||||
Reference in New Issue
Block a user