fix entity and api

This commit is contained in:
AdisakKanthawilang 2024-04-04 17:20:44 +07:00
parent f793c2465b
commit c0f6c5ab9d
3 changed files with 183 additions and 43 deletions

View file

@ -295,7 +295,7 @@ export class DevelopmentEmployeeHistoryController extends Controller {
async GetDevelopemtHistoryById(@Path() id: string) {
const type = "EMPLOYEE";
const getDevelopment = await this.developmentHistoryRepository.findOne({
relations: ["development"],
relations: ["development","employeePosLevel","employeePosType"],
where: { id: id, type: type },
});
if (!getDevelopment) {
@ -310,7 +310,9 @@ export class DevelopmentEmployeeHistoryController extends Controller {
citizenId: getDevelopment.citizenId ? getDevelopment.citizenId : null,
position: getDevelopment.position ? getDevelopment.position : null,
posLevelId: getDevelopment.employeePosLevelId ? getDevelopment.employeePosLevelId : null,
posLevelName: getDevelopment.employeePosLevel.posLevelName ? getDevelopment.employeePosLevel.posLevelName : null,
posTypeId: getDevelopment.employeePosTypeId ? getDevelopment.employeePosTypeId : null,
posTypeName: getDevelopment.employeePosType.posTypeName ? getDevelopment.employeePosType.posTypeName : null,
developmentId: getDevelopment.developmentId ? getDevelopment.developmentId : null,
order: getDevelopment.order ? getDevelopment.order : null,
dateOrder: getDevelopment.dateOrder ? getDevelopment.dateOrder : null,