diff --git a/module/user-extension/helper.js b/module/user-extension/helper.js index 60d2f347..74d03dfa 100644 --- a/module/user-extension/helper.js +++ b/module/user-extension/helper.js @@ -571,13 +571,18 @@ module.exports = class UserExtensionHelper { } for( let program = 0; program < currentRole.programs.length;program++) { - programMapToRole[currentRole.programs[program].toString()] = currentRole.code; + if(programMapToRole[currentRole.programs[program].toString()] && programMapToRole[currentRole.programs[program].toString()].length > 0){ + programMapToRole[currentRole.programs[program].toString()].push(currentRole.code); + }else { + programMapToRole[currentRole.programs[program].toString()] = [currentRole.code]; + } + programIds.push(currentRole.programs[program]); } } } - + const programData = await programsHelper.programDocuments({ _id: {$in: programIds}, status: constants.common.ACTIVE