diff --git a/.github/workflows/release.yaml b/.github/workflows/release.yaml index 09283b90..0d07ac5e 100644 --- a/.github/workflows/release.yaml +++ b/.github/workflows/release.yaml @@ -9,8 +9,8 @@ env: REGISTRY: docker.frappet.com IMAGE_NAME: ehr/bma-ehr-org-service DEPLOY_HOST: frappet.com - COMPOSE_PATH: /home/frappet/docker/bma-ehr - # COMPOSE_PATH: /home/frappet/docker/bma/bma-ehr-org + # COMPOSE_PATH: /home/frappet/docker/bma-ehr + COMPOSE_PATH: /home/frappet/docker/bma/bma-ehr-org jobs: # act workflow_dispatch -W .github/workflows/release.yaml --input IMAGE_VER=latest -s DOCKER_USER=admin -s DOCKER_PASS=FPTadmin2357 -s SSH_PASSWORD=FPTadmin2357 release-test: diff --git a/src/controllers/ProfileController.ts b/src/controllers/ProfileController.ts index c114d30c..bfddaa4d 100644 --- a/src/controllers/ProfileController.ts +++ b/src/controllers/ProfileController.ts @@ -2973,6 +2973,27 @@ export class ProfileController extends Controller { return new HttpSuccess(_profile); } + /** + * API ข้อมูลทะเบียนประวัติตาม keycloakid + * + * @summary ORG_065 - ข้อมูลทะเบียนประวัติตาม keycloakid (ADMIN) #70 + * + */ + @Get("keycloakid/position/{id}") + async getProfileByKeycloakid( + @Request() request: { user: Record }, + @Path() id: string, + ) { + const profile = await this.profileRepo.findOne({ + where: { keycloak: id }, + select: ["id"], + }); + if (!profile) { + throw new HttpError(HttpStatus.NOT_FOUND, "ไม่พบข้อมูลบุคคลนี้ในระบบ"); + } + return new HttpSuccess(profile); + } + /** * API ข้อมูลทะเบียนประวัติตาม citizenId * diff --git a/src/interfaces/call-api.ts b/src/interfaces/call-api.ts index 4cbd1a5a..d6498fab 100644 --- a/src/interfaces/call-api.ts +++ b/src/interfaces/call-api.ts @@ -17,7 +17,7 @@ class CallAPI { //Get public async GetData(request: any, @Path() path: any) { const token = request.headers.authorization; - const url = process.env.API + path; + const url = process.env.API_URL + path; try { const response = await axios.get(url, { headers: { @@ -33,7 +33,7 @@ class CallAPI { //Post public async PostData(request: any, @Path() path: any, sendData: any) { const token = request.headers.authorization; - const url = process.env.API + path; + const url = process.env.API_URL + path; try { const response = await axios.post(url, sendData, { headers: {