Skip to content

Commit

Permalink
Merge pull request #1085 from HDRUK/dev
Browse files Browse the repository at this point in the history
Dev to Release GAT 2500
  • Loading branch information
dnhdruk authored Jun 15, 2023
2 parents fe54b59 + f8082f4 commit df59d57
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 4 deletions.
2 changes: 1 addition & 1 deletion Chart.yaml
Original file line number Diff line number Diff line change
@@ -1 +1 @@
v5.0.5
v5.0.6
15 changes: 12 additions & 3 deletions src/resources/message/message.controller.js
Original file line number Diff line number Diff line change
Expand Up @@ -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]);
Expand Down

0 comments on commit df59d57

Please sign in to comment.