From 0d86a02f5b35643fea332bcdf41fb6002f9e7e0c Mon Sep 17 00:00:00 2001 From: Bright Date: Tue, 14 May 2024 16:20:18 +0700 Subject: [PATCH] =?UTF-8?q?=E0=B8=9B=E0=B8=A3=E0=B8=B1=E0=B8=9Arelation=20?= =?UTF-8?q?geverment?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/entities/ProfileEmployee.ts | 4 ++++ src/entities/ProfileGovernment.ts | 2 +- 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/src/entities/ProfileEmployee.ts b/src/entities/ProfileEmployee.ts index 28533d27..a284db06 100644 --- a/src/entities/ProfileEmployee.ts +++ b/src/entities/ProfileEmployee.ts @@ -20,6 +20,7 @@ import { ProfileEducation } from "./ProfileEducation"; import { ProfileAbility } from "./ProfileAbility"; import { ProfileOther } from "./ProfileOther"; import { ProfileAvatar } from "./ProfileAvatar"; +import { ProfileGovernment } from "./ProfileGovernment"; @Entity("profileEmployee") export class ProfileEmployee extends EntityBase { @Column({ @@ -274,6 +275,9 @@ export class ProfileEmployee extends EntityBase { @OneToMany(() => ProfileEmployeeHistory, (v) => v.profileEmployee) histories: ProfileEmployeeHistory[]; + + @OneToMany(() => ProfileGovernment, (v) => v.profileEmployee) + profileGovernment: ProfileGovernment[]; } @Entity("profileEmployeeHistory") diff --git a/src/entities/ProfileGovernment.ts b/src/entities/ProfileGovernment.ts index 0f675353..f02b89c0 100644 --- a/src/entities/ProfileGovernment.ts +++ b/src/entities/ProfileGovernment.ts @@ -62,7 +62,7 @@ export class ProfileGovernment extends EntityBase { @JoinColumn({ name: "profileId" }) profile: Profile; - @ManyToOne(() => ProfileEmployee, (ProfileEmployee) => ProfileEmployee.profileTrainings) + @ManyToOne(() => ProfileEmployee, (v) => v.profileGovernment) @JoinColumn({ name: "profileEmployeeId" }) profileEmployee: ProfileEmployee; }