no message
This commit is contained in:
parent
bc6e43a700
commit
5530c36f93
2 changed files with 24 additions and 8 deletions
|
|
@ -24,14 +24,12 @@ import { OrgChild3 } from "../entities/OrgChild3";
|
|||
import { OrgChild4 } from "../entities/OrgChild4";
|
||||
import { PosMaster } from "../entities/PosMaster";
|
||||
import { Position } from "../entities/Position";
|
||||
import { ProfileSalary } from "../entities/ProfileSalary";
|
||||
import { Profile } from "../entities/Profile";
|
||||
import { RequestWithUser } from "../middlewares/user";
|
||||
import permission from "../interfaces/permission";
|
||||
import { PermissionOrg } from "../entities/PermissionOrg";
|
||||
import { setLogDataDiff } from "../interfaces/utils";
|
||||
import { AuthRole } from "../entities/AuthRole";
|
||||
import { sendToQueue, sendToQueueOrg } from "../services/rabbitmq";
|
||||
import { sendToQueueOrg } from "../services/rabbitmq";
|
||||
|
||||
@Route("api/v1/org")
|
||||
@Tags("Organization")
|
||||
|
|
@ -676,13 +674,10 @@ export class OrganizationController extends Controller {
|
|||
* @param {string} id Id OrgRevison
|
||||
*/
|
||||
@Get("lock/{id}")
|
||||
async GetById(
|
||||
@Request() request: RequestWithUser,
|
||||
@Path() id: string,
|
||||
) {
|
||||
async GetById(@Request() request: RequestWithUser, @Path() id: string) {
|
||||
//add check permission
|
||||
const orgRevision = await this.orgRevisionRepository.findOne({
|
||||
where: { id: id }
|
||||
where: { id: id },
|
||||
});
|
||||
if (!orgRevision) {
|
||||
throw new HttpError(HttpStatusCode.NOT_FOUND, "ไม่พบข้อมูลโครงสร้าง");
|
||||
|
|
|
|||
|
|
@ -942,4 +942,25 @@ export class OrganizationUnauthorizeController extends Controller {
|
|||
if (val >= 90 && val <= 100) return "ดีเด่น";
|
||||
else return "-";
|
||||
}
|
||||
|
||||
/**
|
||||
* API หาสำนักทั้งหมด
|
||||
*
|
||||
* @summary หาสำนักทั้งหมด
|
||||
*
|
||||
*/
|
||||
@Get("active/root/all")
|
||||
async GetActiveRootAll() {
|
||||
const orgRevisionActive = await this.orgRevisionRepository.findOne({
|
||||
where: { orgRevisionIsCurrent: true, orgRevisionIsDraft: false },
|
||||
});
|
||||
if (!orgRevisionActive) {
|
||||
throw new HttpError(HttpStatusCode.NOT_FOUND, "ไม่พบโครงสร้างที่เผยแพร่อยู่ตอนนี้");
|
||||
}
|
||||
|
||||
const data = await this.orgRootRepository.find({
|
||||
where: { orgRevisionId: orgRevisionActive.id },
|
||||
});
|
||||
return new HttpSuccess(data);
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue