From b51370953865b0fd36e01ffc790b118487758b3b Mon Sep 17 00:00:00 2001 From: Nick Brown Date: Fri, 26 Aug 2022 15:56:40 +0100 Subject: [PATCH] filter owned objects on groupTypes --- .../components/GroupMembershipManager.tsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/samples/react-group-membership-manager/src/webparts/groupMembershipManager/components/GroupMembershipManager.tsx b/samples/react-group-membership-manager/src/webparts/groupMembershipManager/components/GroupMembershipManager.tsx index 05d46a0d0..c2171190f 100644 --- a/samples/react-group-membership-manager/src/webparts/groupMembershipManager/components/GroupMembershipManager.tsx +++ b/samples/react-group-membership-manager/src/webparts/groupMembershipManager/components/GroupMembershipManager.tsx @@ -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); }, []);