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

@ -174,7 +174,8 @@ export class DevelopmentRequestController extends Controller {
@Get("admin/{id}")
public async getDevelopmentRequestByUser(@Path() id: string, @Request() req: RequestWithUser) {
await new permission().PermissionGet(req, "SYS_REGISTRY_OFFICER");
let _workflow = await new permission().Workflow(req, id, "SYS_REGISTRY_OFFICER");
if (_workflow == false) await new permission().PermissionGet(req, "SYS_REGISTRY_OFFICER");
const data = await this.developmentRequestRepository.findOne({
where: { id: id },
relations: ["developmentProjects"],
@ -301,7 +302,7 @@ export class DevelopmentRequestController extends Controller {
});
if (!record) throw new HttpError(HttpStatus.NOT_FOUND, "ไม่พบข้อมูล");
await new permission().PermissionUpdate(req, "SYS_REGISTRY_OFFICER");
if (requestBody.status == "APPROVE" && record.status == "PENDING") {
let profileDevelopment = new ProfileDevelopment();
const meta = {