fixed #2436 add link in noti request idp

This commit is contained in:
Warunee Tamkoo 2026-04-28 14:57:51 +07:00
parent 2417c90dc2
commit 3833901bea

View file

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