@@ -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) {
5252export 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 ) ;
0 commit comments