Skip to content
This repository has been archived by the owner on Oct 19, 2023. It is now read-only.

Commit

Permalink
Fix Select project member
Browse files Browse the repository at this point in the history
  • Loading branch information
jonasnobile committed Mar 10, 2022
1 parent 28a9c53 commit 2dd627f
Showing 1 changed file with 7 additions and 15 deletions.
22 changes: 7 additions & 15 deletions admin/pages/organizations.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -98,12 +98,8 @@ const LIST_PROJECT_MEMBER_QUERY = `
members {
identity {
id
}
memberships {
role
variables {
name
values
person {
id
}
}
}
Expand All @@ -117,14 +113,10 @@ type ListProjectMembers = {
members: {
identity: {
id: string
person: {
id: string
}
}
memberships: {
role: string
variables: {
name: string
values: string[]
}[]
}[]
}[]
}
}
Expand All @@ -133,7 +125,7 @@ const rolesConfig: RolesConfig = {
admin: {
name: 'organizationManager',
variables: {
$personID: {
personID: {
render: () => null,
}
},
Expand All @@ -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
Expand Down

0 comments on commit 2dd627f

Please sign in to comment.