filter owned objects on groupTypes

This commit is contained in:
Nick Brown 2022-08-26 15:56:40 +01:00
parent 48e7cfc7bb
commit b513709538
1 changed files with 1 additions and 1 deletions

View File

@ -36,7 +36,7 @@ export default function GroupMembershipManager(props: IGroupMembershipManagerPro
context.msGraphClientFactory.getClient("3").then((client: MSGraphClientV3) => {
client.api('/me/ownedObjects').select("id,displayName,groupTypes,visibility,mailEnabled,resourceProvisioningOptions,securityEnabled,description").get((error, response: { value: MicrosoftGraph.Group[] }) => {
if (error) throw error;
setGroups(response.value.sort((a, b) => a.displayName.localeCompare(b.displayName)));
setGroups(response.value.filter(g => g.groupTypes).sort((a, b) => a.displayName.localeCompare(b.displayName)));
}).catch(console.error);
}).catch(console.error);
}, []);