get id create
This commit is contained in:
parent
871e2e5247
commit
0b8f9b6c23
36 changed files with 42 additions and 46 deletions
|
|
@ -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}")
|
||||
|
|
|
|||
|
|
@ -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}")
|
||||
|
|
|
|||
|
|
@ -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}")
|
||||
|
|
|
|||
|
|
@ -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}")
|
||||
|
|
|
|||
|
|
@ -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}")
|
||||
|
|
|
|||
|
|
@ -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}")
|
||||
|
|
|
|||
|
|
@ -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}")
|
||||
|
|
|
|||
|
|
@ -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}")
|
||||
|
|
|
|||
|
|
@ -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}")
|
||||
|
|
|
|||
|
|
@ -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}")
|
||||
|
|
|
|||
|
|
@ -135,7 +135,7 @@ export class ProfileDevelopmentEmployeeController extends Controller {
|
|||
);
|
||||
}
|
||||
|
||||
return new HttpSuccess();
|
||||
return new HttpSuccess(data.id);
|
||||
}
|
||||
|
||||
@Patch("{developmentId}")
|
||||
|
|
|
|||
|
|
@ -127,7 +127,7 @@ export class ProfileDevelopmentEmployeeTempController extends Controller {
|
|||
);
|
||||
}
|
||||
|
||||
return new HttpSuccess();
|
||||
return new HttpSuccess(data.id);
|
||||
}
|
||||
|
||||
@Patch("{developmentId}")
|
||||
|
|
|
|||
|
|
@ -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}")
|
||||
|
|
|
|||
|
|
@ -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}")
|
||||
|
|
|
|||
|
|
@ -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}")
|
||||
|
|
|
|||
|
|
@ -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}")
|
||||
|
|
|
|||
|
|
@ -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}")
|
||||
|
|
|
|||
|
|
@ -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}")
|
||||
|
|
|
|||
|
|
@ -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}")
|
||||
|
|
|
|||
|
|
@ -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}")
|
||||
|
|
|
|||
|
|
@ -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}")
|
||||
|
|
|
|||
|
|
@ -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}")
|
||||
|
|
|
|||
|
|
@ -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}")
|
||||
|
|
|
|||
|
|
@ -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}")
|
||||
|
|
|
|||
|
|
@ -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}")
|
||||
|
|
|
|||
|
|
@ -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}")
|
||||
|
|
|
|||
|
|
@ -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}")
|
||||
|
|
|
|||
|
|
@ -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}")
|
||||
|
|
|
|||
|
|
@ -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}")
|
||||
|
|
|
|||
|
|
@ -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}")
|
||||
|
|
|
|||
|
|
@ -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}")
|
||||
|
|
|
|||
|
|
@ -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}")
|
||||
|
|
|
|||
|
|
@ -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}")
|
||||
|
|
|
|||
|
|
@ -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}")
|
||||
|
|
|
|||
|
|
@ -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}")
|
||||
|
|
|
|||
|
|
@ -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}")
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue