Skip to content

Commit

Permalink
Update upsetSpaceUser.js
Browse files Browse the repository at this point in the history
  • Loading branch information
baozhoutao committed Mar 10, 2024
1 parent 011a324 commit 432e987
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion services/standard-space/src/methods/upsetSpaceUser.js
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,10 @@ module.exports = {
modified: new Date()
}, spaceUser))
}else{
const sUser2 = await spaceUsersObj.find({filters: ['username', '=', spaceUser.username]});
let sUser2 = []
if(spaceUser.username){
sUser2 = await spaceUsersObj.find({filters: ['username', '=', spaceUser.username]});
}
if(sUser2.length > 0){
await spaceUsersObj.directUpdate(sUser2[0]._id, Object.assign({
organization,
Expand Down

0 comments on commit 432e987

Please sign in to comment.