diff --git a/src/controllers/PositionController.ts b/src/controllers/PositionController.ts index a65d816f..d063d06a 100644 --- a/src/controllers/PositionController.ts +++ b/src/controllers/PositionController.ts @@ -3199,7 +3199,7 @@ export class PositionController extends Controller { ) { let typeCondition: any = {}; let conditionA = - "posType.posTypeId LIKE :posTypeName AND posLevel.posLevelName LIKE :posLevel AND positions.positionName LIKE :position"; + "posType.posTypeName LIKE :posType AND posLevel.posLevelName LIKE :posLevel AND positions.positionName LIKE :position"; let posType = await this.posTypeRepository.findOne({ where: { id: String(body.posType) }, diff --git a/src/controllers/ProfileController.ts b/src/controllers/ProfileController.ts index 4358d9f3..eac0d2b6 100644 --- a/src/controllers/ProfileController.ts +++ b/src/controllers/ProfileController.ts @@ -2814,6 +2814,25 @@ export class ProfileController extends Controller { return new HttpSuccess(profile); } + /** + * API รายละเอียดรายการทะเบียนประวัติ + * + * @summary ORG_065 - รายละเอียดรายการทะเบียนประวัติ (ADMIN) #70 + * + * @param {string} id Id ทะเบียนประวัติ + */ + @Get("keycloak") + async getProfileIdByKeycloak(@Request() request: RequestWithUser) { + const profile = await this.profileRepo.findOne({ + where: { keycloak: request.user.sub }, + select:["id"] + }); + + if (!profile) throw new HttpError(HttpStatus.NOT_FOUND, "ไม่พบข้อมูล"); + + return new HttpSuccess(profile.id); + } + @Get("type") async checkRole(@Request() request: RequestWithUser) { let role: any;