Skip to content

Commit 7bae3fd

Browse files
authored
Merge pull request #820 from topcoder-platform/pm-1175_2
fix(PM-1175): Applied email not sent
2 parents 37bd5ed + 70e8e40 commit 7bae3fd

File tree

2 files changed

+11
-4
lines changed

2 files changed

+11
-4
lines changed

.circleci/config.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -149,7 +149,7 @@ workflows:
149149
context : org-global
150150
filters:
151151
branches:
152-
only: ['develop', 'migration-setup', 'pm-1173_1']
152+
only: ['develop', 'migration-setup']
153153
- deployProd:
154154
context : org-global
155155
filters:

src/routes/copilotOpportunityApply/create.js

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -71,10 +71,17 @@ module.exports = [
7171
const pmRole = await util.getRolesByRoleName(USER_ROLE.PROJECT_MANAGER, req.log, req.id);
7272
const { subjects = [] } = await util.getRoleInfo(pmRole[0], req.log, req.id);
7373

74-
const creator = await util.getMemberDetailsByUserIds([opportunity.userId], req.log, req.id);
74+
const creator = await util.getMemberDetailsByUserIds([opportunity.createdBy], req.log, req.id);
75+
7576
const listOfSubjects = subjects;
76-
if (creator) {
77-
const isCreatorPartofSubjects = subjects.find(item => item.email.toLowerCase() === creator[0].email.toLowerCase());
77+
if (creator && creator[0] && creator[0].email) {
78+
const isCreatorPartofSubjects = subjects.find(item => {
79+
if (!item.email) {
80+
return false;
81+
}
82+
83+
return item.email.toLowerCase() === creator[0].email.toLowerCase();
84+
});
7885
if (!isCreatorPartofSubjects) {
7986
listOfSubjects.push({
8087
email: creator[0].email,

0 commit comments

Comments
 (0)