update librerias
This commit is contained in:
@@ -22,7 +22,7 @@ export class InstitucionProgramaService {
|
||||
|
||||
create(programa: string) {
|
||||
return this.programaRepository
|
||||
.findOne({ programa })
|
||||
.findOne({ where: { programa } })
|
||||
.then((existePrograma) => {
|
||||
if (existePrograma)
|
||||
throw new ConflictException('Ya existe este programa.');
|
||||
@@ -85,18 +85,22 @@ export class InstitucionProgramaService {
|
||||
}
|
||||
|
||||
findProgramaById(id_programa: number) {
|
||||
return this.programaRepository.findOne({ id_programa }).then((programa) => {
|
||||
if (!programa) throw new NotFoundException('No existe este programa.');
|
||||
return programa;
|
||||
});
|
||||
return this.programaRepository
|
||||
.findOne({ where: { id_programa } })
|
||||
.then((programa) => {
|
||||
if (!programa) throw new NotFoundException('No existe este programa.');
|
||||
return programa;
|
||||
});
|
||||
}
|
||||
|
||||
findProgramaByPrograma(programa: string, validarNoExiste = true) {
|
||||
return this.programaRepository.findOne({ programa }).then((programa) => {
|
||||
if (validarNoExiste && !programa)
|
||||
throw new NotFoundException('No existe este programa.');
|
||||
return programa;
|
||||
});
|
||||
return this.programaRepository
|
||||
.findOne({ where: { programa } })
|
||||
.then((programa) => {
|
||||
if (validarNoExiste && !programa)
|
||||
throw new NotFoundException('No existe este programa.');
|
||||
return programa;
|
||||
});
|
||||
}
|
||||
|
||||
update(admin: Operador, attrs: Partial<InstitucionPrograma>) {
|
||||
|
||||
Reference in New Issue
Block a user