check workflow

This commit is contained in:
kittapath 2024-10-22 08:20:45 +07:00
parent 4c2188a363
commit 32b0aa325d
74 changed files with 529 additions and 285 deletions

View file

@ -49,7 +49,9 @@ export class ProfileChildrenEmployeeController extends Controller {
@Get("{profileEmployeeId}")
public async getChildren(@Path() profileEmployeeId: string, @Request() req: RequestWithUser) {
await new permission().PermissionOrgUserGet(req, "SYS_REGISTRY_EMP", profileEmployeeId);
let _workflow = await new permission().Workflow(req, profileEmployeeId, "SYS_REGISTRY_EMP");
if (_workflow == false)
await new permission().PermissionOrgUserGet(req, "SYS_REGISTRY_EMP", profileEmployeeId);
const lists = await this.childrenRepository.find({
where: { profileEmployeeId: profileEmployeeId },
order: { createdAt: "ASC" },
@ -61,11 +63,13 @@ export class ProfileChildrenEmployeeController extends Controller {
public async childrenHistory(@Path() childrenId: string, @Request() req: RequestWithUser) {
const _record = await this.childrenRepository.findOneBy({ id: childrenId });
if (_record) {
await new permission().PermissionOrgUserGet(
req,
"SYS_REGISTRY_EMP",
_record.profileEmployeeId,
);
let _workflow = await new permission().Workflow(req, childrenId, "SYS_REGISTRY_EMP");
if (_workflow == false)
await new permission().PermissionOrgUserGet(
req,
"SYS_REGISTRY_EMP",
_record.profileEmployeeId,
);
}
const record = await this.childrenHistoryRepository.find({
where: { profileChildrenId: childrenId },