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

@ -291,7 +291,7 @@ export class DevelopmentOfficerHistoryController extends Controller {
async GetDevelopemtHistoryById(@Path() id: string) {
const type = "OFFICER";
const getDevelopment = await this.developmentHistoryRepository.findOne({
relations: ["development"],
relations: ["development","posLevel","posType"],
where: { id: id, type: type },
});
if (!getDevelopment) {
@ -306,7 +306,9 @@ export class DevelopmentOfficerHistoryController extends Controller {
citizenId: getDevelopment.citizenId ? getDevelopment.citizenId : null,
position: getDevelopment.position ? getDevelopment.position : null,
posLevelId: getDevelopment.posLevelId ? getDevelopment.posLevelId : null,
posLevelName: getDevelopment.posLevel.posLevelName ? getDevelopment.posLevel.posLevelName : null,
posTypeId: getDevelopment.posTypeId ? getDevelopment.posTypeId : null,
posTypeName: getDevelopment.posType.posTypeName ? getDevelopment.posType.posTypeName : null,
developmentId: getDevelopment.developmentId ? getDevelopment.developmentId : null,
order: getDevelopment.order ? getDevelopment.order : null,
dateOrder: getDevelopment.dateOrder ? getDevelopment.dateOrder : null,