no message

This commit is contained in:
Bright 2024-10-10 13:07:10 +07:00
parent e43c29dbc4
commit 8eb643c435

View file

@ -2039,13 +2039,13 @@ export class CommandController extends Controller {
body: {
data: {
bodyProfile: CreateProfileAllFields;
bodyEducations: CreateProfileEducation[];
bodyCertificates: CreateProfileCertificate[];
bodySalarys: CreateProfileSalary;
bodyPosition: {
bodyEducations?: CreateProfileEducation[];
bodyCertificates?: CreateProfileCertificate[];
bodySalarys?: CreateProfileSalary | null;
bodyPosition?: {
posmasterId: string;
positionId: string;
};
} | null;
}[];
},
) {
@ -2101,9 +2101,9 @@ export class CommandController extends Controller {
await this.profileRepository.save(profile);
setLogDataDiff(req, { before, after: profile });
}
if(profile && profile.id) {
//Educations
if(item.bodyEducations && item.bodyEducations.length > 0) {
await Promise.all(
item.bodyEducations.map(async (education) => {
const profileEdu = new ProfileEducation();
@ -2117,7 +2117,10 @@ export class CommandController extends Controller {
await this.profileEducationHistoryRepo.save(eduHistory, { data: req });
}),
);
}
//Certificates
if(item.bodyCertificates && item.bodyCertificates.length > 0) {
await Promise.all(
item.bodyCertificates.map(async (cer) => {
const profileCer = new ProfileCertificate();
@ -2131,7 +2134,10 @@ export class CommandController extends Controller {
await this.certificateHistoryRepo.save(cerHistory, { data: req });
}),
);
}
//Salary
if(item.bodySalarys && item.bodySalarys != null) {
const dest_item = await this.salaryRepo.findOne({
where: { profileId: profile.id },
order: { order: "DESC" },
@ -2146,7 +2152,10 @@ export class CommandController extends Controller {
setLogDataDiff(req, { before, after: profileSal });
salaryHistory.profileSalaryId = profileSal.id;
await this.salaryHistoryRepo.save(salaryHistory, { data: req });
}
//Position
if(item.bodyPosition && item.bodyPosition != null) {
const posMaster = await this.posMasterRepository.findOne({
where: { id: item.bodyPosition.posmasterId },
});
@ -2206,6 +2215,7 @@ export class CommandController extends Controller {
await this.positionRepository.save(positionNew, { data: req });
}
}
}
}),
);
return new HttpSuccess();