listo para producción
This commit is contained in:
@@ -30,7 +30,7 @@ const update = async (body) => {
|
||||
.then((res) => {
|
||||
if (idStatus) {
|
||||
if (!res) throw new Error('No existe este status.');
|
||||
if (idStatus >= 6 && !motivo)
|
||||
if (!motivo)
|
||||
throw new Error('No se mando el motivo de cambio de status.');
|
||||
update.idStatus = idStatus;
|
||||
}
|
||||
@@ -55,7 +55,7 @@ const update = async (body) => {
|
||||
})
|
||||
.then(async (res) => {
|
||||
if (!res) throw new Error('No existe este equipo.');
|
||||
if (idStatus >= 6) await Motivo.create({ motivo, idEquipo, idStatus });
|
||||
if (idStatus) await Motivo.create({ motivo, idEquipo, idStatus });
|
||||
return Equipo.update(update, { where: { idEquipo } });
|
||||
})
|
||||
.then(() => ({ message: 'Se actualizó correctamente el equipo.' }));
|
||||
|
||||
@@ -13,7 +13,7 @@ const historialMotivosEquipo = async (body) => {
|
||||
{
|
||||
model: Equipo,
|
||||
where: { idEquipo },
|
||||
// attributes: [],
|
||||
attributes: [],
|
||||
},
|
||||
{ model: Status },
|
||||
],
|
||||
|
||||
Reference in New Issue
Block a user