no message
This commit is contained in:
parent
729f322bf1
commit
de8944dbc9
3 changed files with 10 additions and 12 deletions
|
|
@ -2166,7 +2166,6 @@ export class CommandController extends Controller {
|
|||
firstName: profile.firstName,
|
||||
lastName: profile.lastName,
|
||||
email: profile.email,
|
||||
requiredActions: ["UPDATE_PASSWORD"],
|
||||
});
|
||||
if (typeof userKeycloakId !== "string") {
|
||||
throw new Error(userKeycloakId.errorMessage);
|
||||
|
|
@ -2188,9 +2187,9 @@ export class CommandController extends Controller {
|
|||
await this.profileRepository.save(profile);
|
||||
setLogDataDiff(req, { before, after: profile });
|
||||
}
|
||||
if(profile && profile.id) {
|
||||
if (profile && profile.id) {
|
||||
//Educations
|
||||
if(item.bodyEducations && item.bodyEducations.length > 0) {
|
||||
if (item.bodyEducations && item.bodyEducations.length > 0) {
|
||||
await Promise.all(
|
||||
item.bodyEducations.map(async (education) => {
|
||||
const profileEdu = new ProfileEducation();
|
||||
|
|
@ -2205,9 +2204,9 @@ export class CommandController extends Controller {
|
|||
}),
|
||||
);
|
||||
}
|
||||
|
||||
|
||||
//Certificates
|
||||
if(item.bodyCertificates && item.bodyCertificates.length > 0) {
|
||||
if (item.bodyCertificates && item.bodyCertificates.length > 0) {
|
||||
await Promise.all(
|
||||
item.bodyCertificates.map(async (cer) => {
|
||||
const profileCer = new ProfileCertificate();
|
||||
|
|
@ -2223,7 +2222,7 @@ export class CommandController extends Controller {
|
|||
);
|
||||
}
|
||||
//Salary
|
||||
if(item.bodySalarys && item.bodySalarys != null) {
|
||||
if (item.bodySalarys && item.bodySalarys != null) {
|
||||
const dest_item = await this.salaryRepo.findOne({
|
||||
where: { profileId: profile.id },
|
||||
order: { order: "DESC" },
|
||||
|
|
@ -2232,7 +2231,7 @@ export class CommandController extends Controller {
|
|||
Object.assign(profileSal, { ...item.bodySalarys, ...meta });
|
||||
const salaryHistory = new ProfileSalaryHistory();
|
||||
Object.assign(salaryHistory, { ...profileSal, id: undefined });
|
||||
profileSal.order = dest_item == null ? 1 : dest_item.order + 1
|
||||
profileSal.order = dest_item == null ? 1 : dest_item.order + 1;
|
||||
profileSal.profileId = profile.id;
|
||||
await this.salaryRepo.save(profileSal, { data: req });
|
||||
setLogDataDiff(req, { before, after: profileSal });
|
||||
|
|
@ -2240,11 +2239,11 @@ export class CommandController extends Controller {
|
|||
await this.salaryHistoryRepo.save(salaryHistory, { data: req });
|
||||
}
|
||||
//Position
|
||||
if(item.bodyPosition && item.bodyPosition != null) {
|
||||
if (item.bodyPosition && item.bodyPosition != null) {
|
||||
const posMaster = await this.posMasterRepository.findOne({
|
||||
where: { id: item.bodyPosition.posmasterId },
|
||||
});
|
||||
if (posMaster == null)
|
||||
if (posMaster == null)
|
||||
throw new HttpError(HttpStatusCode.NOT_FOUND, "ไม่พบข้อมูลตำแหน่งนี้");
|
||||
|
||||
const posMasterOld = await this.posMasterRepository.findOne({
|
||||
|
|
@ -2295,7 +2294,7 @@ export class CommandController extends Controller {
|
|||
profile.posLevelId = positionNew.posLevelId;
|
||||
profile.posTypeId = positionNew.posTypeId;
|
||||
profile.position = positionNew.positionName;
|
||||
await this.profileRepository.save(profile, { data: req });
|
||||
await this.profileRepository.save(profile, { data: req });
|
||||
setLogDataDiff(req, { before, after: profile });
|
||||
await this.positionRepository.save(positionNew, { data: req });
|
||||
}
|
||||
|
|
|
|||
|
|
@ -98,7 +98,6 @@ export class KeycloakController extends Controller {
|
|||
firstName: body.firstName,
|
||||
lastName: body.lastName,
|
||||
email: body.email,
|
||||
requiredActions: ["UPDATE_PASSWORD"],
|
||||
});
|
||||
|
||||
if (typeof userId !== "string") {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue