carga masiva equipo a medias
This commit is contained in:
@@ -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) => {
|
||||
|
||||
Reference in New Issue
Block a user