File tree Expand file tree Collapse file tree 1 file changed +6
-1
lines changed
src/routes/projectMemberInvites Expand file tree Collapse file tree 1 file changed +6
-1
lines changed Original file line number Diff line number Diff line change @@ -270,7 +270,12 @@ module.exports = [
270270 }
271271
272272 // get member details by handles first
273- return util . getMemberDetailsByHandles ( invite . handles , req . log , req . id ) . then ( ( inviteUsers ) => {
273+ return util . getMemberDetailsByHandles ( invite . handles , req . log , req . id )
274+ // we have to filter users returned by the Message Service so we only invite the users
275+ // whom we are inviting, because Message Service has a loose search logic and may return
276+ // users with handles whom we didn't search for
277+ . then ( foundUsers => foundUsers . filter ( foundUser => _ . includes ( invite . handles , foundUser . handle ) ) )
278+ . then ( ( inviteUsers ) => {
274279 const members = req . context . currentProjectMembers ;
275280 const projectId = _ . parseInt ( req . params . projectId ) ;
276281 // check user handle exists in returned result
You can’t perform that action at this time.
0 commit comments