แก้ไขบัค employeeSalary

This commit is contained in:
AnandaTon 2024-05-17 09:42:49 +07:00
parent 067231d291
commit 6f74d3ddcc
3 changed files with 5 additions and 8 deletions

View file

@ -67,7 +67,7 @@ export class ProfileSalaryEmployeeController extends Controller {
} }
const dest_item = await this.salaryRepo.findOne({ const dest_item = await this.salaryRepo.findOne({
where: { profileId: body.profileEmployeeId }, where: { profileEmployeeId: body.profileEmployeeId },
order: { order: "DESC" }, order: { order: "DESC" },
}); });

View file

@ -148,6 +148,10 @@ export class ProfileSalary extends EntityBase {
@ManyToOne(() => Profile, (profile) => profile.profileSalary) @ManyToOne(() => Profile, (profile) => profile.profileSalary)
@JoinColumn({ name: "profileId" }) @JoinColumn({ name: "profileId" })
profile: Profile; profile: Profile;
@ManyToOne(() => ProfileEmployee, (ProfileEmployee) => ProfileEmployee.profileSalarys)
@JoinColumn({ name: "profileEmployeeId" })
profileEmployee: ProfileEmployee;
} }
export class CreateProfileSalary { export class CreateProfileSalary {

View file

@ -14,13 +14,6 @@ import { ProfileSalary } from "./ProfileSalary";
@Entity("profileSalaryHistory") @Entity("profileSalaryHistory")
export class ProfileSalaryHistory extends EntityBase { export class ProfileSalaryHistory extends EntityBase {
@Column({
length: 40,
comment: "คีย์นอก(FK)ของตาราง profile",
type: "uuid",
})
profileId: string;
@Column({ @Column({
comment: "วันที่", comment: "วันที่",
type: "datetime", type: "datetime",