From 2dd627fb4fda7bc1f9d4c7562d42bbf5ef9e45fd Mon Sep 17 00:00:00 2001 From: jonasNobile Date: Thu, 10 Mar 2022 11:32:52 +0100 Subject: [PATCH] Fix Select project member --- admin/pages/organizations.tsx | 22 +++++++--------------- 1 file changed, 7 insertions(+), 15 deletions(-) diff --git a/admin/pages/organizations.tsx b/admin/pages/organizations.tsx index 465c2b9..59f4e73 100644 --- a/admin/pages/organizations.tsx +++ b/admin/pages/organizations.tsx @@ -98,12 +98,8 @@ const LIST_PROJECT_MEMBER_QUERY = ` members { identity { id - } - memberships { - role - variables { - name - values + person { + id } } } @@ -117,14 +113,10 @@ type ListProjectMembers = { members: { identity: { id: string + person: { + id: string + } } - memberships: { - role: string - variables: { - name: string - values: string[] - }[] - }[] }[] } } @@ -133,7 +125,7 @@ const rolesConfig: RolesConfig = { admin: { name: 'organizationManager', variables: { - $personID: { + personID: { render: () => null, } }, @@ -150,7 +142,7 @@ const EditUser = Component( return null } - const currentMember = query.data.projectBySlug.members.find(member => member.memberships.find(membership => membership.role === 'organizationManager')?.variables.find(variable => variable.name === 'personId')?.values.includes(personId)) + const currentMember = query.data.projectBySlug.members.find(member => member.identity?.person?.id === personId) if (!currentMember) { return null