carga masiva equipo a medias

This commit is contained in:
xXpuma99Xx
2022-06-06 15:00:36 -05:00
parent 3f34526041
commit 23755c50bf
11 changed files with 279 additions and 87 deletions
+17
View File
@@ -60,6 +60,23 @@ export class ModuloService {
});
}
async findModulo(
id_institucion: number | Institucion,
modulo: string,
validarNoExiste = true,
) {
const institucion =
typeof id_institucion === 'number'
? await this.institucionService.findById(id_institucion)
: id_institucion;
return this.repository.findOne({ institucion, modulo }).then((modulo) => {
if (validarNoExiste && !modulo)
throw new ConflictException('No existe este módulo.');
return modulo;
});
}
update(attrs: Partial<Modulo>) {
return this.findById(attrs.id_modulo)
.then(async (modulo) => {