|
@@ -194,7 +194,7 @@ class UserGroupRelation {
|
|
|
* @returns {Promise<User>}
|
|
* @returns {Promise<User>}
|
|
|
* @memberof UserGroupRelation
|
|
* @memberof UserGroupRelation
|
|
|
*/
|
|
*/
|
|
|
- static findUserByNotRelatedGroup(userGroup) {
|
|
|
|
|
|
|
+ static findUserByNotRelatedGroup(userGroup, queryOptions) {
|
|
|
const User = UserGroupRelation.crowi.model('User');
|
|
const User = UserGroupRelation.crowi.model('User');
|
|
|
|
|
|
|
|
return this.findAllRelationForUserGroup(userGroup)
|
|
return this.findAllRelationForUserGroup(userGroup)
|
|
@@ -202,7 +202,11 @@ class UserGroupRelation {
|
|
|
const relatedUserIds = relations.map((relation) => {
|
|
const relatedUserIds = relations.map((relation) => {
|
|
|
return relation.relatedUser.id;
|
|
return relation.relatedUser.id;
|
|
|
});
|
|
});
|
|
|
- const query = { _id: { $nin: relatedUserIds }, status: User.STATUS_ACTIVE };
|
|
|
|
|
|
|
+ const query = {
|
|
|
|
|
+ _id: { $nin: relatedUserIds },
|
|
|
|
|
+ status: User.STATUS_ACTIVE,
|
|
|
|
|
+ username: `/${queryOptions.searchWord}/`,
|
|
|
|
|
+ };
|
|
|
|
|
|
|
|
debug('findUserByNotRelatedGroup ', query);
|
|
debug('findUserByNotRelatedGroup ', query);
|
|
|
return User.find(query).exec();
|
|
return User.find(query).exec();
|