equipo programa service final
This commit is contained in:
@@ -21,14 +21,14 @@ export class InstitucionProgramaService {
|
||||
) {}
|
||||
|
||||
create(programa: string) {
|
||||
// Busco un programa con ese nombre
|
||||
// Buscamos un programa con ese nombre
|
||||
return this.programaRepository
|
||||
.findOne({ where: { programa } })
|
||||
.then((existePrograma) => {
|
||||
// Saco error si existe
|
||||
if (existePrograma)
|
||||
throw new ConflictException('Ya existe este programa.');
|
||||
// Creo y guardo el registro
|
||||
// Creamos y guardamos el registro
|
||||
return this.programaRepository.save(
|
||||
this.programaRepository.create({ programa }),
|
||||
);
|
||||
|
||||
Reference in New Issue
Block a user