yusuketk 6 lat temu
rodzic
commit
4bad317933
1 zmienionych plików z 11 dodań i 8 usunięć
  1. 11 8
      src/server/models/user-group-relation.js

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

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