diff --git a/src/controllers/WorkflowController.ts b/src/controllers/WorkflowController.ts index bc1d37c4..23091552 100644 --- a/src/controllers/WorkflowController.ts +++ b/src/controllers/WorkflowController.ts @@ -238,12 +238,15 @@ export class WorkflowController extends Controller { ); // add link sysName = REGISTRY_PROFILE or REGISTRY_PROFILE_EMP - let notiLink = ''; - if (body.sysName === 'REGISTRY_PROFILE') { + let notiLink = ""; + if (body.sysName === "REGISTRY_PROFILE") { notiLink = `${process.env.VITE_URL_MGT}/registry-officer/request-edit/personal/${body.refId}`; - } else if (body.sysName === 'REGISTRY_PROFILE_EMP') { + } else if (body.sysName === "REGISTRY_PROFILE_EMP") { notiLink = `${process.env.VITE_URL_MGT}/registry-employee/request-edit/personal/${body.refId}`; + } else if (body.sysName === "REGISTRY_IDP") { + notiLink = `${process.env.VITE_URL_MGT}/registry-officer/request-edit-page/${body.refId}`; } + const notificationReceivers = stateOperatorUsersToCreate .filter((user) => firstStateOperators.some((op) => op.operator === user.operator)) .map((user) => ({ @@ -911,14 +914,14 @@ export class WorkflowController extends Controller { const roodIds = [posMasterUser.orgRootId]; const orgRoot = await this.orgRootRepo.findOne({ select: { id: true, isDeputy: true }, - where: { + where: { id: Not(posMasterUser.orgRootId), isDeputy: true, orgRevision: { orgRevisionIsCurrent: true, orgRevisionIsDraft: false }, }, }); if (orgRoot && orgRoot.isDeputy) { - roodIds.push(orgRoot.id) + roodIds.push(orgRoot.id); } // 2. Pre-calculate conditions - ย้ายออกมาข้างนอก