Skip to content

Commit 8539d7b

Browse files
use imsOrgId for mapping
1 parent 3c68ee3 commit 8539d7b

File tree

2 files changed

+7
-4
lines changed

2 files changed

+7
-4
lines changed

src/tasks/demo-url-processor/handler.js

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -22,8 +22,8 @@ const TASK_TYPE = 'demo-url-processor';
2222
* @param {object} log - The log object
2323
* @returns {string} The IMS tenant ID
2424
*/
25-
function getImsTenantId(organization, context, log) {
26-
const { name, imsOrgId } = organization;
25+
function getImsTenantId(imsOrgId, organization, context, log) {
26+
const { name } = organization;
2727
try {
2828
const imsOrgToTenantMapping = context.env.IMS_ORG_TENANT_ID_MAPPINGS;
2929
if (imsOrgToTenantMapping) {
@@ -52,7 +52,9 @@ function getImsTenantId(organization, context, log) {
5252
export async function runDemoUrlProcessor(message, context) {
5353
const { log, env, dataAccess } = context;
5454
const { Organization } = dataAccess;
55-
const { siteId, organizationId, taskContext } = message;
55+
const {
56+
siteId, imsOrgId, organizationId, taskContext,
57+
} = message;
5658
const {
5759
experienceUrl, slackContext,
5860
} = taskContext;
@@ -71,7 +73,7 @@ export async function runDemoUrlProcessor(message, context) {
7173
return ok({ message: 'Organization not found' });
7274
}
7375

74-
const imsTenantId = getImsTenantId(organization, context, log);
76+
const imsTenantId = getImsTenantId(imsOrgId, organization, context, log);
7577
const demoUrl = `${experienceUrl}?organizationId=${organizationId}#/@${imsTenantId}/sites-optimizer/sites/${siteId}/home`;
7678
const slackMessage = `:white_check_mark: Setup complete! Access your demo environment here: ${demoUrl}`;
7779
await say(env, log, slackContext, slackMessage);

test/tasks/demo-url-processor/demo-url-processor.test.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -50,6 +50,7 @@ describe('Demo URL Processor', () => {
5050
// Mock message
5151
message = {
5252
siteId: 'test-site-id',
53+
imsOrgId: '8C6043F15F43B6390A49401A@AdobeOrg',
5354
organizationId: 'test-org-id',
5455
taskContext: {
5556
experienceUrl: 'https://example.com',

0 commit comments

Comments
 (0)