diff --git a/src/controllers/ProfileAbilityController.ts b/src/controllers/ProfileAbilityController.ts index 41409586..dc641c1a 100644 --- a/src/controllers/ProfileAbilityController.ts +++ b/src/controllers/ProfileAbilityController.ts @@ -134,7 +134,7 @@ export class ProfileAbilityController extends Controller { history.profileAbilityId = data.id; await this.profileAbilityHistoryRepo.save(history, { data: req }); //setLogDataDiff(req, { before, after: history }); - return new HttpSuccess(); + return new HttpSuccess(data.id); } @Patch("{abilityId}") diff --git a/src/controllers/ProfileAbilityEmployeeController.ts b/src/controllers/ProfileAbilityEmployeeController.ts index b77f2ba1..eca0cd8c 100644 --- a/src/controllers/ProfileAbilityEmployeeController.ts +++ b/src/controllers/ProfileAbilityEmployeeController.ts @@ -139,7 +139,7 @@ export class ProfileAbilityEmployeeController extends Controller { await this.profileAbilityHistoryRepo.save(history, { data: req }); //setLogDataDiff(req, { before, after: history }); - return new HttpSuccess(); + return new HttpSuccess(data.id); } @Patch("{abilityId}") diff --git a/src/controllers/ProfileAbilityEmployeeTempController.ts b/src/controllers/ProfileAbilityEmployeeTempController.ts index 60c3d023..335ac04c 100644 --- a/src/controllers/ProfileAbilityEmployeeTempController.ts +++ b/src/controllers/ProfileAbilityEmployeeTempController.ts @@ -133,7 +133,7 @@ export class ProfileAbilityEmployeeTempController extends Controller { await this.profileAbilityHistoryRepo.save(history, { data: req }); //setLogDataDiff(req, { before, after: history }); - return new HttpSuccess(); + return new HttpSuccess(data.id); } @Patch("{abilityId}") diff --git a/src/controllers/ProfileCertificateController.ts b/src/controllers/ProfileCertificateController.ts index 4cdcf024..9ad35786 100644 --- a/src/controllers/ProfileCertificateController.ts +++ b/src/controllers/ProfileCertificateController.ts @@ -126,7 +126,7 @@ export class ProfileCertificateController extends Controller { await this.certificateHistoryRepo.save(history, { data: req }); //setLogDataDiff(req, { before, after: history }); - return new HttpSuccess(); + return new HttpSuccess(data.id); } @Patch("{certificateId}") diff --git a/src/controllers/ProfileCertificateEmployeeController.ts b/src/controllers/ProfileCertificateEmployeeController.ts index db2e9dde..33d00bfa 100644 --- a/src/controllers/ProfileCertificateEmployeeController.ts +++ b/src/controllers/ProfileCertificateEmployeeController.ts @@ -130,7 +130,7 @@ export class ProfileCertificateEmployeeController extends Controller { await this.certificateHistoryRepo.save(history, { data: req }); //setLogDataDiff(req, { before, after: history }); - return new HttpSuccess(); + return new HttpSuccess(data.id); } @Patch("{certificateId}") diff --git a/src/controllers/ProfileCertificateEmployeeTempController.ts b/src/controllers/ProfileCertificateEmployeeTempController.ts index 66f9d3cc..f0eec89c 100644 --- a/src/controllers/ProfileCertificateEmployeeTempController.ts +++ b/src/controllers/ProfileCertificateEmployeeTempController.ts @@ -121,7 +121,7 @@ export class ProfileCertificateEmployeeTempController extends Controller { await this.certificateHistoryRepo.save(history, { data: req }); setLogDataDiff(req, { before, after: history }); - return new HttpSuccess(); + return new HttpSuccess(data.id); } @Patch("{certificateId}") diff --git a/src/controllers/ProfileChildrenController.ts b/src/controllers/ProfileChildrenController.ts index 205352d1..27075758 100644 --- a/src/controllers/ProfileChildrenController.ts +++ b/src/controllers/ProfileChildrenController.ts @@ -104,7 +104,7 @@ export class ProfileChildrenController extends Controller { await this.childrenHistoryRepository.save(history, { data: req }); //setLogDataDiff(req, { before, after: history }); - return new HttpSuccess(); + return new HttpSuccess(data.id); } @Patch("{childrenId}") diff --git a/src/controllers/ProfileChildrenEmployeeController.ts b/src/controllers/ProfileChildrenEmployeeController.ts index 1d4f46d6..a8792e7b 100644 --- a/src/controllers/ProfileChildrenEmployeeController.ts +++ b/src/controllers/ProfileChildrenEmployeeController.ts @@ -111,7 +111,8 @@ export class ProfileChildrenEmployeeController extends Controller { history.profileChildrenId = data.id; await this.childrenHistoryRepository.save(history, { data: req }); setLogDataDiff(req, { before, after: history }); - return new HttpSuccess(); + + return new HttpSuccess(data.id); } @Patch("{childrenId}") diff --git a/src/controllers/ProfileChildrenEmployeeTempController.ts b/src/controllers/ProfileChildrenEmployeeTempController.ts index 874af63c..4ee31e5f 100644 --- a/src/controllers/ProfileChildrenEmployeeTempController.ts +++ b/src/controllers/ProfileChildrenEmployeeTempController.ts @@ -103,7 +103,7 @@ export class ProfileChildrenEmployeeTempController extends Controller { await this.childrenHistoryRepository.save(history, { data: req }); //setLogDataDiff(req, { before, after: history }); - return new HttpSuccess(); + return new HttpSuccess(data.id); } @Patch("{childrenId}") diff --git a/src/controllers/ProfileDevelopmentController.ts b/src/controllers/ProfileDevelopmentController.ts index 1d9149dd..754b8de1 100644 --- a/src/controllers/ProfileDevelopmentController.ts +++ b/src/controllers/ProfileDevelopmentController.ts @@ -127,23 +127,18 @@ export class ProfileDevelopmentController extends Controller { public async developmentDetail( @Path() developmentId: string, @Path() type: string, - @Request() req: RequestWithUser + @Request() req: RequestWithUser, ) { const data = await this.developmentRequestRepository.findOne({ where: { id: developmentId }, relations: ["developmentProjects"], }); - if (!data) - throw new HttpError(HttpStatus.NOT_FOUND, "ไม่พบรายการพัฒนารายบุคคลดังกล่าว"); + if (!data) throw new HttpError(HttpStatus.NOT_FOUND, "ไม่พบรายการพัฒนารายบุคคลดังกล่าว"); if (type.trim().toLocaleUpperCase() == "OFFICER") { let _workflow = await new permission().Workflow(req, developmentId, "SYS_REGISTRY_OFFICER"); if (_workflow == false) - await new permission().PermissionOrgUserGet( - req, - "SYS_REGISTRY_OFFICER", - data.profileId, - ); + await new permission().PermissionOrgUserGet(req, "SYS_REGISTRY_OFFICER", data.profileId); } else if (type.trim().toLocaleUpperCase() == "EMPLOYEE") { let _workflow = await new permission().Workflow(req, developmentId, "SYS_REGISTRY_EMP"); if (_workflow == false) @@ -183,8 +178,8 @@ export class ProfileDevelopmentController extends Controller { reasonDevelopment10: data.reasonDevelopment10, selectType: null, selectTypeYear: null, - selectTypeId: null - } + selectTypeId: null, + }; const _data = { ..._mapData, developmentProjects: data.developmentProjects.map((x) => x.name), @@ -249,7 +244,7 @@ export class ProfileDevelopmentController extends Controller { ); } - return new HttpSuccess(); + return new HttpSuccess(data.id); } @Patch("{developmentId}") diff --git a/src/controllers/ProfileDevelopmentEmployeeController.ts b/src/controllers/ProfileDevelopmentEmployeeController.ts index 025740e4..5843cee5 100644 --- a/src/controllers/ProfileDevelopmentEmployeeController.ts +++ b/src/controllers/ProfileDevelopmentEmployeeController.ts @@ -135,7 +135,7 @@ export class ProfileDevelopmentEmployeeController extends Controller { ); } - return new HttpSuccess(); + return new HttpSuccess(data.id); } @Patch("{developmentId}") diff --git a/src/controllers/ProfileDevelopmentEmployeeTempController.ts b/src/controllers/ProfileDevelopmentEmployeeTempController.ts index 768fd87e..84cfa074 100644 --- a/src/controllers/ProfileDevelopmentEmployeeTempController.ts +++ b/src/controllers/ProfileDevelopmentEmployeeTempController.ts @@ -127,7 +127,7 @@ export class ProfileDevelopmentEmployeeTempController extends Controller { ); } - return new HttpSuccess(); + return new HttpSuccess(data.id); } @Patch("{developmentId}") diff --git a/src/controllers/ProfileDisciplineController.ts b/src/controllers/ProfileDisciplineController.ts index e29af310..efcd6444 100644 --- a/src/controllers/ProfileDisciplineController.ts +++ b/src/controllers/ProfileDisciplineController.ts @@ -133,7 +133,7 @@ export class ProfileDisciplineController extends Controller { await this.disciplineHistoryRepository.save(history, { data: req }); //setLogDataDiff(req, { before, after: history }); - return new HttpSuccess(); + return new HttpSuccess(data.id); } @Patch("{disciplineId}") diff --git a/src/controllers/ProfileDisciplineEmployeeController.ts b/src/controllers/ProfileDisciplineEmployeeController.ts index e934e668..d1c11906 100644 --- a/src/controllers/ProfileDisciplineEmployeeController.ts +++ b/src/controllers/ProfileDisciplineEmployeeController.ts @@ -135,7 +135,7 @@ export class ProfileDisciplineEmployeeController extends Controller { history.profileDisciplineId = data.id; await this.disciplineHistoryRepository.save(history, { data: req }); //setLogDataDiff(req, { before, after: history }); - return new HttpSuccess(); + return new HttpSuccess(data.id); } @Patch("{disciplineId}") diff --git a/src/controllers/ProfileDisciplineEmployeeTempController.ts b/src/controllers/ProfileDisciplineEmployeeTempController.ts index b981d567..f6b19d3d 100644 --- a/src/controllers/ProfileDisciplineEmployeeTempController.ts +++ b/src/controllers/ProfileDisciplineEmployeeTempController.ts @@ -128,7 +128,7 @@ export class ProfileDisciplineEmployeeTempController extends Controller { await this.disciplineHistoryRepository.save(history, { data: req }); //setLogDataDiff(req, { before, after: history }); - return new HttpSuccess(); + return new HttpSuccess(data.id); } @Patch("{disciplineId}") diff --git a/src/controllers/ProfileDutyController.ts b/src/controllers/ProfileDutyController.ts index a9b4865c..faed5e72 100644 --- a/src/controllers/ProfileDutyController.ts +++ b/src/controllers/ProfileDutyController.ts @@ -110,7 +110,7 @@ export class ProfileDutyController extends Controller { history.profileDutyId = data.id; await this.dutyHistoryRepository.save(history, { data: req }); //setLogDataDiff(req, { before, after: history }); - return new HttpSuccess(); + return new HttpSuccess(data.id); } @Patch("{dutyId}") diff --git a/src/controllers/ProfileDutyEmployeeController.ts b/src/controllers/ProfileDutyEmployeeController.ts index 2093b375..9974fbc1 100644 --- a/src/controllers/ProfileDutyEmployeeController.ts +++ b/src/controllers/ProfileDutyEmployeeController.ts @@ -115,7 +115,7 @@ export class ProfileDutyEmployeeController extends Controller { await this.dutyHistoryRepository.save(history, { data: req }); //setLogDataDiff(req, { before, after: history }); - return new HttpSuccess(); + return new HttpSuccess(data.id); } @Patch("{dutyId}") diff --git a/src/controllers/ProfileDutyEmployeeTempController.ts b/src/controllers/ProfileDutyEmployeeTempController.ts index 7b199560..3b5223d5 100644 --- a/src/controllers/ProfileDutyEmployeeTempController.ts +++ b/src/controllers/ProfileDutyEmployeeTempController.ts @@ -107,7 +107,7 @@ export class ProfileDutyEmployeeTempController extends Controller { await this.dutyHistoryRepository.save(history, { data: req }); //setLogDataDiff(req, { before, after: history }); - return new HttpSuccess(); + return new HttpSuccess(data.id); } @Patch("{dutyId}") diff --git a/src/controllers/ProfileEducationsController.ts b/src/controllers/ProfileEducationsController.ts index fe3bd49c..e01c7e30 100644 --- a/src/controllers/ProfileEducationsController.ts +++ b/src/controllers/ProfileEducationsController.ts @@ -145,7 +145,7 @@ export class ProfileEducationsController extends Controller { await this.profileEducationHistoryRepo.save(history, { data: req }); //setLogDataDiff(req, { before, after: history }); - return new HttpSuccess(); + return new HttpSuccess(data.id); } @Patch("{educationId}") diff --git a/src/controllers/ProfileEducationsEmployeeController.ts b/src/controllers/ProfileEducationsEmployeeController.ts index d152c6af..d181ae96 100644 --- a/src/controllers/ProfileEducationsEmployeeController.ts +++ b/src/controllers/ProfileEducationsEmployeeController.ts @@ -151,7 +151,7 @@ export class ProfileEducationsEmployeeController extends Controller { await this.profileEducationHistoryRepo.save(history, { data: req }); //setLogDataDiff(req, { before, after: history }); - return new HttpSuccess(); + return new HttpSuccess(data.id); } @Patch("{educationId}") diff --git a/src/controllers/ProfileEducationsEmployeeTempController.ts b/src/controllers/ProfileEducationsEmployeeTempController.ts index 6204e6e6..045e493d 100644 --- a/src/controllers/ProfileEducationsEmployeeTempController.ts +++ b/src/controllers/ProfileEducationsEmployeeTempController.ts @@ -141,7 +141,7 @@ export class ProfileEducationsEmployeeTempController extends Controller { await this.profileEducationHistoryRepo.save(history, { data: req }); //setLogDataDiff(req, { before, after: history }); - return new HttpSuccess(); + return new HttpSuccess(data.id); } @Patch("{educationId}") diff --git a/src/controllers/ProfileHonorController.ts b/src/controllers/ProfileHonorController.ts index 536161f9..82348c1c 100644 --- a/src/controllers/ProfileHonorController.ts +++ b/src/controllers/ProfileHonorController.ts @@ -137,7 +137,7 @@ export class ProfileHonorController extends Controller { history.profileHonorId = data.id; await this.honorHistoryRepo.save(history, { data: req }); - return new HttpSuccess(); + return new HttpSuccess(data.id); } @Patch("{honorId}") diff --git a/src/controllers/ProfileHonorEmployeeController.ts b/src/controllers/ProfileHonorEmployeeController.ts index 1d6928ab..34bae5f0 100644 --- a/src/controllers/ProfileHonorEmployeeController.ts +++ b/src/controllers/ProfileHonorEmployeeController.ts @@ -145,7 +145,7 @@ export class ProfileHonorEmployeeController extends Controller { history.profileHonorId = data.id; await this.honorHistoryRepo.save(history, { data: req }); - return new HttpSuccess(); + return new HttpSuccess(data.id); } @Patch("{honorId}") diff --git a/src/controllers/ProfileHonorEmployeeTempController.ts b/src/controllers/ProfileHonorEmployeeTempController.ts index fb14c035..deea0a2a 100644 --- a/src/controllers/ProfileHonorEmployeeTempController.ts +++ b/src/controllers/ProfileHonorEmployeeTempController.ts @@ -136,7 +136,7 @@ export class ProfileHonorEmployeeTempController extends Controller { history.profileHonorId = data.id; await this.honorHistoryRepo.save(history, { data: req }); - return new HttpSuccess(); + return new HttpSuccess(data.id); } @Patch("{honorId}") diff --git a/src/controllers/ProfileLeaveController.ts b/src/controllers/ProfileLeaveController.ts index 80fcef9f..ae7bcfe3 100644 --- a/src/controllers/ProfileLeaveController.ts +++ b/src/controllers/ProfileLeaveController.ts @@ -215,7 +215,7 @@ export class ProfileLeaveController extends Controller { history.profileLeaveId = data.id; await this.leaveHistoryRepo.save(history, { data: req }); - return new HttpSuccess(); + return new HttpSuccess(data.id); } @Patch("{leaveId}") diff --git a/src/controllers/ProfileLeaveEmployeeController.ts b/src/controllers/ProfileLeaveEmployeeController.ts index f3c010de..feb6891e 100644 --- a/src/controllers/ProfileLeaveEmployeeController.ts +++ b/src/controllers/ProfileLeaveEmployeeController.ts @@ -143,7 +143,7 @@ export class ProfileLeaveEmployeeController extends Controller { history.profileLeaveId = data.id; await this.leaveHistoryRepo.save(history, { data: req }); - return new HttpSuccess(); + return new HttpSuccess(data.id); } @Patch("{leaveId}") diff --git a/src/controllers/ProfileLeaveEmployeeTempController.ts b/src/controllers/ProfileLeaveEmployeeTempController.ts index 28d6a621..39506d32 100644 --- a/src/controllers/ProfileLeaveEmployeeTempController.ts +++ b/src/controllers/ProfileLeaveEmployeeTempController.ts @@ -133,7 +133,7 @@ export class ProfileLeaveEmployeeTempController extends Controller { history.profileLeaveId = data.id; await this.leaveHistoryRepo.save(history); - return new HttpSuccess(); + return new HttpSuccess(data.id); } @Patch("{leaveId}") diff --git a/src/controllers/ProfileNopaidController.ts b/src/controllers/ProfileNopaidController.ts index ecd4fc9d..6bc26043 100644 --- a/src/controllers/ProfileNopaidController.ts +++ b/src/controllers/ProfileNopaidController.ts @@ -101,7 +101,7 @@ export class ProfileNopaidController extends Controller { history.profileNopaidId = data.id; await this.nopaidHistoryRepository.save(history, { data: req }); - return new HttpSuccess(); + return new HttpSuccess(data.id); } @Patch("{nopaidId}") diff --git a/src/controllers/ProfileNopaidEmployeeController.ts b/src/controllers/ProfileNopaidEmployeeController.ts index 7f5eb3af..f7d506b4 100644 --- a/src/controllers/ProfileNopaidEmployeeController.ts +++ b/src/controllers/ProfileNopaidEmployeeController.ts @@ -103,7 +103,7 @@ export class ProfileNopaidEmployeeController extends Controller { history.profileNopaidId = data.id; await this.nopaidHistoryRepository.save(history, { data: req }); - return new HttpSuccess(); + return new HttpSuccess(data.id); } @Patch("{nopaidId}") diff --git a/src/controllers/ProfileNopaidEmployeeTempController.ts b/src/controllers/ProfileNopaidEmployeeTempController.ts index fca6b1c7..8ff058ec 100644 --- a/src/controllers/ProfileNopaidEmployeeTempController.ts +++ b/src/controllers/ProfileNopaidEmployeeTempController.ts @@ -104,7 +104,7 @@ export class ProfileNopaidEmployeeTempController extends Controller { history.profileNopaidId = data.id; await this.nopaidHistoryRepository.save(history, { data: req }); - return new HttpSuccess(); + return new HttpSuccess(data.id); } @Patch("{nopaidId}") diff --git a/src/controllers/ProfileOtherController.ts b/src/controllers/ProfileOtherController.ts index cf988fd6..79ae8c8f 100644 --- a/src/controllers/ProfileOtherController.ts +++ b/src/controllers/ProfileOtherController.ts @@ -111,7 +111,7 @@ export class ProfileOtherController extends Controller { history.profileOtherId = data.id; await this.otherHistoryRepository.save(history, { data: req }); - return new HttpSuccess(); + return new HttpSuccess(data.id); } @Patch("{otherId}") diff --git a/src/controllers/ProfileOtherEmployeeController.ts b/src/controllers/ProfileOtherEmployeeController.ts index a17ec51a..0a6622b6 100644 --- a/src/controllers/ProfileOtherEmployeeController.ts +++ b/src/controllers/ProfileOtherEmployeeController.ts @@ -118,7 +118,7 @@ export class ProfileOtherEmployeeController extends Controller { history.profileOtherId = data.id; await this.otherHistoryRepository.save(history, { data: req }); - return new HttpSuccess(); + return new HttpSuccess(data.id); } @Patch("{otherId}") diff --git a/src/controllers/ProfileOtherEmployeeTempController.ts b/src/controllers/ProfileOtherEmployeeTempController.ts index f56287e6..38962384 100644 --- a/src/controllers/ProfileOtherEmployeeTempController.ts +++ b/src/controllers/ProfileOtherEmployeeTempController.ts @@ -110,7 +110,7 @@ export class ProfileOtherEmployeeTempController extends Controller { history.profileOtherId = data.id; await this.otherHistoryRepository.save(history, { data: req }); - return new HttpSuccess(); + return new HttpSuccess(data.id); } @Patch("{otherId}") diff --git a/src/controllers/ProfileTrainingController.ts b/src/controllers/ProfileTrainingController.ts index 0e67a061..c331fdb9 100644 --- a/src/controllers/ProfileTrainingController.ts +++ b/src/controllers/ProfileTrainingController.ts @@ -118,7 +118,7 @@ export class ProfileTrainingController extends Controller { history.profileTrainingId = data.id; await this.trainingHistoryRepo.save(history, { data: req }); - return new HttpSuccess(); + return new HttpSuccess(data.id); } @Patch("{trainingId}") diff --git a/src/controllers/ProfileTrainingEmployeeController.ts b/src/controllers/ProfileTrainingEmployeeController.ts index 66f5ebb8..60f1c2ac 100644 --- a/src/controllers/ProfileTrainingEmployeeController.ts +++ b/src/controllers/ProfileTrainingEmployeeController.ts @@ -126,7 +126,7 @@ export class ProfileTrainingEmployeeController extends Controller { history.profileTrainingId = data.id; await this.trainingHistoryRepo.save(history, { data: req }); - return new HttpSuccess(); + return new HttpSuccess(data.id); } @Patch("{trainingId}") diff --git a/src/controllers/ProfileTrainingEmployeeTempController.ts b/src/controllers/ProfileTrainingEmployeeTempController.ts index 10894d4a..64e6fdcd 100644 --- a/src/controllers/ProfileTrainingEmployeeTempController.ts +++ b/src/controllers/ProfileTrainingEmployeeTempController.ts @@ -117,7 +117,7 @@ export class ProfileTrainingEmployeeTempController extends Controller { history.profileTrainingId = data.id; await this.trainingHistoryRepo.save(history, { data: req }); - return new HttpSuccess(); + return new HttpSuccess(data.id); } @Patch("{trainingId}")