listo carrera programa
This commit is contained in:
@@ -47,7 +47,10 @@ export class CarreraProgramaService {
|
||||
);
|
||||
// Busco un registro que ya contenga la info mandada
|
||||
return this.repository
|
||||
.findOne({ where: { institucionCarrera, programa } })
|
||||
.findOne({
|
||||
select: { id_carrera_programa: true },
|
||||
where: { institucionCarrera, programa },
|
||||
})
|
||||
.then((existeCarretaPrograma) => {
|
||||
// Si lo encuentro saco error
|
||||
if (existeCarretaPrograma)
|
||||
|
||||
@@ -1,4 +1,10 @@
|
||||
import { Entity, JoinColumn, ManyToOne, PrimaryGeneratedColumn } from 'typeorm';
|
||||
import {
|
||||
Column,
|
||||
Entity,
|
||||
JoinColumn,
|
||||
ManyToOne,
|
||||
PrimaryGeneratedColumn,
|
||||
} from 'typeorm';
|
||||
import { InstitucionCarrera } from '../../institucion-carrera/entity/institucion-carrera.entity';
|
||||
import { Programa } from '../../institucion-programa/entity/programa.entity';
|
||||
|
||||
@@ -7,6 +13,12 @@ export class CarreraPrograma {
|
||||
@PrimaryGeneratedColumn()
|
||||
id_carrera_programa: number;
|
||||
|
||||
@Column({ type: Number, nullable: true })
|
||||
id_institucion_carrera: number;
|
||||
|
||||
@Column({ type: Number, nullable: true })
|
||||
id_programa: number;
|
||||
|
||||
@ManyToOne(
|
||||
() => InstitucionCarrera,
|
||||
(institucionCarrera) => institucionCarrera.programas,
|
||||
|
||||
Reference in New Issue
Block a user