แก้ env
This commit is contained in:
parent
5859a46666
commit
360bfe22a8
3 changed files with 25 additions and 4 deletions
|
|
@ -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<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
|
||||
*
|
||||
|
|
|
|||
|
|
@ -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: {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue