comentarios

This commit is contained in:
2022-10-15 18:54:49 -05:00
parent ace78c2a62
commit cc0f3e8773
2 changed files with 6 additions and 1 deletions
@@ -53,7 +53,6 @@ export class EquipoProgramaService {
throw new ConflictException(
'Este software ya fue asignado a este equipo.',
);
// Creo registro
return this.create(equipo, programa);
},
);
@@ -105,7 +104,9 @@ export class EquipoProgramaService {
return this.repository
.count({ where: { equipo: equipoPrograma.equipo } })
.then(async (n) => {
// Asignar "Sin programa" si es que solo tiene 1, el que se va a eliminar
if (n === 1) await this.createSinPrograma(equipoPrograma.equipo);
// Eliminar registro
return this.repository.remove(equipoPrograma);
})
.then((_) => ({