diff --git a/src/controllers/ProfileGovernmentController.ts b/src/controllers/ProfileGovernmentController.ts index 518e3e12..42304e69 100644 --- a/src/controllers/ProfileGovernmentController.ts +++ b/src/controllers/ProfileGovernmentController.ts @@ -1,28 +1,11 @@ -import { - Body, - Controller, - Delete, - Example, - Get, - Patch, - Path, - Post, - Request, - Route, - Security, - Tags, -} from "tsoa"; +import { Body, Controller, Example, Get, Patch, Path, Request, Route, Security, Tags } from "tsoa"; import { AppDataSource } from "../database/data-source"; import HttpSuccess from "../interfaces/http-success"; import HttpStatus from "../interfaces/http-status"; import HttpError from "../interfaces/http-error"; import { RequestWithUser } from "../middlewares/user"; import { Profile } from "../entities/Profile"; -import { - CreateProfileGovernment, - ProfileGovernment, - UpdateProfileGovernment, -} from "../entities/ProfileGovernment"; +import { ProfileGovernment, UpdateProfileGovernment } from "../entities/ProfileGovernment"; import { Position } from "../entities/Position"; import { PosMaster } from "../entities/PosMaster"; import { calculateAge, calculateRetireDate } from "../interfaces/utils"; @@ -112,7 +95,7 @@ export class ProfileGovernmentHistoryController extends Controller { org: org, //สังกัด positionField: position == null ? null : position.positionField, //สายงาน position: record.position, //ตำแหน่ง - posLevel: record.posLevel.posLevelName, //ระดับ + posLevel: record.posLevel?.posLevelName || null, //ระดับ posMasterNo: posMaster == null ? null : `${orgShortName} ${posMaster.posMasterNo}`, //เลขที่ตำแหน่ง posType: record.posType.posTypeName, //ประเภท posExecutive: