get id create

This commit is contained in:
kittapath 2025-01-29 10:15:19 +07:00
parent 871e2e5247
commit 0b8f9b6c23
36 changed files with 42 additions and 46 deletions

View file

@ -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}")

View file

@ -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}")

View file

@ -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}")

View file

@ -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}")

View file

@ -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}")

View file

@ -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}")

View file

@ -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}")

View file

@ -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}")

View file

@ -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}")

View file

@ -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}")

View file

@ -135,7 +135,7 @@ export class ProfileDevelopmentEmployeeController extends Controller {
);
}
return new HttpSuccess();
return new HttpSuccess(data.id);
}
@Patch("{developmentId}")

View file

@ -127,7 +127,7 @@ export class ProfileDevelopmentEmployeeTempController extends Controller {
);
}
return new HttpSuccess();
return new HttpSuccess(data.id);
}
@Patch("{developmentId}")

View file

@ -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}")

View file

@ -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}")

View file

@ -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}")

View file

@ -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}")

View file

@ -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}")

View file

@ -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}")

View file

@ -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}")

View file

@ -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}")

View file

@ -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}")

View file

@ -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}")

View file

@ -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}")

View file

@ -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}")

View file

@ -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}")

View file

@ -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}")

View file

@ -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}")

View file

@ -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}")

View file

@ -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}")

View file

@ -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}")

View file

@ -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}")

View file

@ -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}")

View file

@ -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}")

View file

@ -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}")

View file

@ -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}")

View file

@ -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}")