no usar en pruebas

This commit is contained in:
xXpuma99Xx
2022-04-27 00:47:09 -05:00
parent 739d689311
commit 4224e04f05
15 changed files with 306 additions and 31 deletions
+6 -5
View File
@@ -17,10 +17,6 @@ export class ModuloService {
async create(id_institucion: number, modulo: string) {
const institucion = await this.institucionService.findById(id_institucion);
const nuevoModulo = this.repository.create({
institucion,
modulo,
});
return this.repository
.findOne({ modulo, institucion })
@@ -29,7 +25,12 @@ export class ModuloService {
throw new ConflictException(
'Ya existe un módulo con este nombre, intente con otro nombre.',
);
return this.repository.save(nuevoModulo);
return this.repository.save(
this.repository.create({
institucion,
modulo,
}),
);
})
.then((_) => ({ message: 'Se creo correctamente el módulo.' }));
}