เช็ค สกจ
This commit is contained in:
parent
87b6fdf0d2
commit
5440bce257
5 changed files with 101 additions and 99 deletions
|
|
@ -63,6 +63,7 @@ import { updateName } from "../keycloak";
|
|||
import permission from "../interfaces/permission";
|
||||
import { PosMasterAct } from "../entities/PosMasterAct";
|
||||
import axios from "axios";
|
||||
import { OrgChild1 } from "../entities/OrgChild1";
|
||||
@Route("api/v1/org/profile")
|
||||
@Tags("Profile")
|
||||
@Security("bearerAuth")
|
||||
|
|
@ -101,6 +102,7 @@ export class ProfileController extends Controller {
|
|||
private disciplineHistoryRepository = AppDataSource.getRepository(ProfileDisciplineHistory);
|
||||
private profileLeaveRepository = AppDataSource.getRepository(ProfileLeave);
|
||||
private posMasterActRepository = AppDataSource.getRepository(PosMasterAct);
|
||||
private orgChild1Repository = AppDataSource.getRepository(OrgChild1);
|
||||
|
||||
/**
|
||||
* report ประวัติแบบย่อ ข้าราชการ
|
||||
|
|
@ -3407,6 +3409,32 @@ export class ProfileController extends Controller {
|
|||
return new HttpSuccess(_profile);
|
||||
}
|
||||
|
||||
/**
|
||||
* API เช็ค สกจ
|
||||
*
|
||||
* @summary เช็ค สกจ
|
||||
*
|
||||
*/
|
||||
@Get("keycloak/idofficer")
|
||||
async getIsOfficerByKeycloak(@Request() request: RequestWithUser) {
|
||||
const posMasters = await this.posMasterRepo.findOne({
|
||||
where: {
|
||||
current_holder: {
|
||||
keycloak: request.user.sub,
|
||||
},
|
||||
orgRevision: {
|
||||
orgRevisionIsCurrent: true,
|
||||
orgRevisionIsDraft: false,
|
||||
},
|
||||
},
|
||||
relations: ["orgChild1"],
|
||||
});
|
||||
if (!posMasters) {
|
||||
return new HttpSuccess(false);
|
||||
}
|
||||
return new HttpSuccess(posMasters.orgChild1.isOfficer);
|
||||
}
|
||||
|
||||
/**
|
||||
* API ข้อมูลทะเบียนประวัติตาม keycloakid
|
||||
*
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue