diff --git a/src/controllers/WorkflowController.ts b/src/controllers/WorkflowController.ts index 0609c932..bc1d37c4 100644 --- a/src/controllers/WorkflowController.ts +++ b/src/controllers/WorkflowController.ts @@ -237,11 +237,18 @@ export class WorkflowController extends Controller { savedStates.find((state) => state.id === so.stateId && state.order === 1), ); + // add link sysName = REGISTRY_PROFILE or REGISTRY_PROFILE_EMP + 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') { + notiLink = `${process.env.VITE_URL_MGT}/registry-employee/request-edit/personal/${body.refId}`; + } const notificationReceivers = stateOperatorUsersToCreate .filter((user) => firstStateOperators.some((op) => op.operator === user.operator)) .map((user) => ({ receiverUserId: user.profileType === "OFFICER" ? user.profileId : user.profileEmployeeId, - notiLink: "", + notiLink: notiLink, })); // ส่ง notification แบบ fire-and-forget