no usar en pruebas
This commit is contained in:
@@ -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.' }));
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user