แก้ env

This commit is contained in:
Kittapath 2024-07-09 17:03:09 +07:00
parent 5859a46666
commit 360bfe22a8
3 changed files with 25 additions and 4 deletions

View file

@ -9,8 +9,8 @@ env:
REGISTRY: docker.frappet.com REGISTRY: docker.frappet.com
IMAGE_NAME: ehr/bma-ehr-org-service IMAGE_NAME: ehr/bma-ehr-org-service
DEPLOY_HOST: frappet.com DEPLOY_HOST: frappet.com
COMPOSE_PATH: /home/frappet/docker/bma-ehr # COMPOSE_PATH: /home/frappet/docker/bma-ehr
# COMPOSE_PATH: /home/frappet/docker/bma/bma-ehr-org COMPOSE_PATH: /home/frappet/docker/bma/bma-ehr-org
jobs: 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 # 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: release-test:

View file

@ -2973,6 +2973,27 @@ export class ProfileController extends Controller {
return new HttpSuccess(_profile); return new HttpSuccess(_profile);
} }
/**
* API keycloakid
*
* @summary ORG_065 - keycloakid (ADMIN) #70
*
*/
@Get("keycloakid/position/{id}")
async getProfileByKeycloakid(
@Request() request: { user: Record<string, any> },
@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 * API citizenId
* *

View file

@ -17,7 +17,7 @@ class CallAPI {
//Get //Get
public async GetData(request: any, @Path() path: any) { public async GetData(request: any, @Path() path: any) {
const token = request.headers.authorization; const token = request.headers.authorization;
const url = process.env.API + path; const url = process.env.API_URL + path;
try { try {
const response = await axios.get(url, { const response = await axios.get(url, {
headers: { headers: {
@ -33,7 +33,7 @@ class CallAPI {
//Post //Post
public async PostData(request: any, @Path() path: any, sendData: any) { public async PostData(request: any, @Path() path: any, sendData: any) {
const token = request.headers.authorization; const token = request.headers.authorization;
const url = process.env.API + path; const url = process.env.API_URL + path;
try { try {
const response = await axios.post(url, sendData, { const response = await axios.post(url, sendData, {
headers: { headers: {