Sfoglia il codice sorgente

Ref to ObjectIdLike

Futa Arai 2 anni fa
parent
commit
f663911a66
1 ha cambiato i file con 3 aggiunte e 2 eliminazioni
  1. 3 2
      apps/app/src/server/util/granted-group.ts

+ 3 - 2
apps/app/src/server/util/granted-group.ts

@@ -10,11 +10,12 @@ export const divideByType = (grantedGroups: GrantedGroup[]): {
   const grantedExternalUserGroups: ObjectIdLike[] = [];
   const grantedExternalUserGroups: ObjectIdLike[] = [];
 
 
   grantedGroups.forEach((group) => {
   grantedGroups.forEach((group) => {
+    const id = typeof group.item === 'string' ? group.item : group.item._id;
     if (group.type === GroupType.userGroup) {
     if (group.type === GroupType.userGroup) {
-      grantedUserGroups.push(group.item);
+      grantedUserGroups.push(id);
     }
     }
     else {
     else {
-      grantedExternalUserGroups.push(group.item);
+      grantedExternalUserGroups.push(id);
     }
     }
   });
   });