-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #1085 from HDRUK/dev
Dev to Release GAT 2500
- Loading branch information
Showing
2 changed files
with
13 additions
and
4 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1 @@ | ||
v5.0.5 | ||
v5.0.6 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -131,16 +131,25 @@ module.exports = { | |
[constants.teamNotificationTypes.DATAACCESSREQUEST] | ||
); | ||
if (!_.isEmpty(subscribedMembersByType)) { | ||
|
||
// build cleaner array of memberIds from subscribedMembersByType | ||
if (topicObj.topicMessages !== undefined) { | ||
const memberIds = [...subscribedMembersByType.map(m => m.memberid.toString()), ...topicObj.createdBy._id.toString()]; | ||
const memberIds = [...subscribedMembersByType.map(m => { | ||
if (m.roles.includes('custodian.dar.manager')) { | ||
return m.memberid.toString(); | ||
} | ||
}), ...topicObj.createdBy._id.toString()].filter(elem => elem); | ||
// returns array of objects [{email: '[email protected] '}] for members in subscribed emails users is list of full user object | ||
const { memberEmails } = teamController.getMemberDetails([...memberIds], [...messageRecipients]); | ||
messageRecipients = [...teamNotificationEmails, ...memberEmails]; | ||
} else { | ||
const memberIds = [...subscribedMembersByType.map(m => m.memberid.toString())].filter( | ||
const memberIds = [...subscribedMembersByType.map(m => { | ||
if (m.roles.includes('custodian.dar.manager')) { | ||
return m.memberid.toString(); | ||
} | ||
})].filter( | ||
ele => ele !== topicObj.createdBy.toString() | ||
); | ||
).filter(elem => elem); | ||
const creatorObjectId = topicObj.createdBy.toString(); | ||
// returns array of objects [{email: '[email protected] '}] for members in subscribed emails users is list of full user object | ||
const { memberEmails } = teamController.getMemberDetails([...memberIds], [...messageRecipients]); | ||
|