yusuketk 6 лет назад
Родитель
Сommit
73d4a40942
1 измененных файлов с 6 добавлено и 11 удалено
  1. 6 11
      src/server/models/user-group-relation.js

+ 6 - 11
src/server/models/user-group-relation.js

@@ -88,17 +88,12 @@ class UserGroupRelation {
     const User = UserGroupRelation.crowi.model('User');
     const User = UserGroupRelation.crowi.model('User');
     debug('findAllRelationForUserGroup is called', userGroup);
     debug('findAllRelationForUserGroup is called', userGroup);
     return this
     return this
-      .find({ relatedGroup: userGroup }, null,
-        {
-          populate: {
-            path: 'relatedUser',
-            select: User.USER_PUBLIC_FIELDS,
-            populate: {
-              path: 'imageAttachment',
-              select: User.IMAGE_POPULATION,
-            },
-          },
-        })
+      .find({ relatedGroup: userGroup })
+      .populate({
+        path: 'relatedUser',
+        select: User.USER_PUBLIC_FIELDS,
+        populate: User.IMAGE_POPULATION,
+      })
       .exec();
       .exec();
   }
   }