diff --git a/src/controllers/ProfileSalaryEmployeeController.ts b/src/controllers/ProfileSalaryEmployeeController.ts index fe23df2b..ceeb0110 100644 --- a/src/controllers/ProfileSalaryEmployeeController.ts +++ b/src/controllers/ProfileSalaryEmployeeController.ts @@ -67,7 +67,7 @@ export class ProfileSalaryEmployeeController extends Controller { } const dest_item = await this.salaryRepo.findOne({ - where: { profileId: body.profileEmployeeId }, + where: { profileEmployeeId: body.profileEmployeeId }, order: { order: "DESC" }, }); diff --git a/src/entities/ProfileSalary.ts b/src/entities/ProfileSalary.ts index 1f568f7d..3feac6ac 100644 --- a/src/entities/ProfileSalary.ts +++ b/src/entities/ProfileSalary.ts @@ -148,6 +148,10 @@ export class ProfileSalary extends EntityBase { @ManyToOne(() => Profile, (profile) => profile.profileSalary) @JoinColumn({ name: "profileId" }) profile: Profile; + + @ManyToOne(() => ProfileEmployee, (ProfileEmployee) => ProfileEmployee.profileSalarys) + @JoinColumn({ name: "profileEmployeeId" }) + profileEmployee: ProfileEmployee; } export class CreateProfileSalary {