Skip to content
Merged
Show file tree
Hide file tree
Changes from 5 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -149,7 +149,7 @@ workflows:
context : org-global
filters:
branches:
only: ['develop', 'migration-setup', 'pm-1173_1']
only: ['develop', 'migration-setup', 'pm-1175_2']
- deployProd:
context : org-global
filters:
Expand Down
19 changes: 16 additions & 3 deletions src/routes/copilotOpportunityApply/create.js
Original file line number Diff line number Diff line change
Expand Up @@ -71,17 +71,30 @@ module.exports = [
const pmRole = await util.getRolesByRoleName(USER_ROLE.PROJECT_MANAGER, req.log, req.id);
const { subjects = [] } = await util.getRoleInfo(pmRole[0], req.log, req.id);

const creator = await util.getMemberDetailsByUserIds([opportunity.userId], req.log, req.id);
req.log.debug(subjects, 'all manager subjects');

const creator = await util.getMemberDetailsByUserIds([opportunity.createdBy], req.log, req.id);
req.log.debug(creator, 'creator', opportunity.createdBy);

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The addition of opportunity.createdBy to the debug log statement provides more context, which can be useful for debugging purposes. However, ensure that this additional information does not expose sensitive data. If opportunity.createdBy contains sensitive information, consider masking or obfuscating it before logging.


const listOfSubjects = subjects;
if (creator) {
const isCreatorPartofSubjects = subjects.find(item => item.email.toLowerCase() === creator[0].email.toLowerCase());
if (creator && creator[0] && creator[0].email) {
const isCreatorPartofSubjects = subjects.find(item => {
if (!item.email) {
return false;
}

return item.email.toLowerCase() === creator[0].email.toLowerCase();
});
req.log.debug(isCreatorPartofSubjects, 'isCreatorPartofSubjects');
if (!isCreatorPartofSubjects) {
listOfSubjects.push({
email: creator[0].email,
handle: creator[0].handle,
});
}
}

req.log.debug(listOfSubjects, 'final list of subjects');

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Consider removing or adjusting the debug log statement if it is not needed for production. Debug logs can be useful during development but may clutter the log files in a production environment.


const emailEventType = CONNECT_NOTIFICATION_EVENT.EXTERNAL_ACTION_EMAIL;
const copilotPortalUrl = config.get('copilotPortalUrl');
Expand Down