Kaynağa Gözat

ownerUserGroup -> ownerUserGroups

Shun Miyazawa 1 yıl önce
ebeveyn
işleme
1282a1a7c2

+ 2 - 2
apps/app/src/features/openai/server/services/openai.ts

@@ -485,7 +485,7 @@ class OpenaiService implements IOpenaiService {
     }
     }
 
 
     if (accessScope === AiAssistantAccessScope.OWNER) {
     if (accessScope === AiAssistantAccessScope.OWNER) {
-      const ownerUserGroup = [
+      const ownerUserGroups = [
         ...(await UserGroupRelation.findAllUserGroupIdsRelatedToUser(owner)),
         ...(await UserGroupRelation.findAllUserGroupIdsRelatedToUser(owner)),
         ...(await ExternalUserGroupRelation.findAllUserGroupIdsRelatedToUser(owner)),
         ...(await ExternalUserGroupRelation.findAllUserGroupIdsRelatedToUser(owner)),
       ].map(group => group.toString());
       ].map(group => group.toString());
@@ -497,7 +497,7 @@ class OpenaiService implements IOpenaiService {
             grant: { $in: [PageGrant.GRANT_PUBLIC, PageGrant.GRANT_USER_GROUP, PageGrant.GRANT_OWNER] },
             grant: { $in: [PageGrant.GRANT_PUBLIC, PageGrant.GRANT_USER_GROUP, PageGrant.GRANT_OWNER] },
             path: { $in: converterdPagePatgPatterns },
             path: { $in: converterdPagePatgPatterns },
             $or: [
             $or: [
-              { 'grantedGroups.item': { $in: ownerUserGroup } },
+              { 'grantedGroups.item': { $in: ownerUserGroups } },
               { grantedUsers: { $in: [getIdForRef(owner)] } },
               { grantedUsers: { $in: [getIdForRef(owner)] } },
               { grant: PageGrant.GRANT_PUBLIC },
               { grant: PageGrant.GRANT_PUBLIC },
             ],
             ],