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

@ -48,7 +48,9 @@ export class ProfileOtherEmployeeController extends Controller {
@Get("{profileId}")
public async getOther(@Path() profileId: string, @Request() req: RequestWithUser) {
await new permission().PermissionOrgUserGet(req, "SYS_REGISTRY_EMP", profileId);
let _workflow = await new permission().Workflow(req, profileId, "SYS_REGISTRY_EMP");
if (_workflow == false)
await new permission().PermissionOrgUserGet(req, "SYS_REGISTRY_EMP", profileId);
const lists = await this.otherRepository.find({
where: { profileEmployeeId: profileId },
order: { createdAt: "ASC" },
@ -60,11 +62,13 @@ export class ProfileOtherEmployeeController extends Controller {
public async otherAdminHistory(@Path() otherId: string, @Request() req: RequestWithUser) {
const _record = await this.otherRepository.findOneBy({ id: otherId });
if (_record) {
await new permission().PermissionOrgUserGet(
req,
"SYS_REGISTRY_EMP",
_record.profileEmployeeId,
);
let _workflow = await new permission().Workflow(req, otherId, "SYS_REGISTRY_EMP");
if (_workflow == false)
await new permission().PermissionOrgUserGet(
req,
"SYS_REGISTRY_EMP",
_record.profileEmployeeId,
);
}
const record = await this.otherHistoryRepository.find({
where: { profileOtherId: otherId },