|
|
@@ -99,7 +99,12 @@ class UserGroupRelation {
|
|
|
return this
|
|
|
.find({ relatedUser: user.id })
|
|
|
.populate('relatedGroup')
|
|
|
- .exec();
|
|
|
+ // filter documents only relatedGroup is not null
|
|
|
+ .then(userGroupRelations => {
|
|
|
+ return userGroupRelations.filter(relation => {
|
|
|
+ return relation.relatedGroup != null;
|
|
|
+ });
|
|
|
+ });
|
|
|
}
|
|
|
|
|
|
/**
|