fix: Cannot remove user from collection in beta sharing UI
This commit is contained in:
@@ -146,18 +146,20 @@ function CollectionMemberList({ collection, invitedInSession }: Props) {
|
||||
<InputMemberPermissionSelect
|
||||
style={{ margin: 0 }}
|
||||
permissions={permissions}
|
||||
onChange={async (permission: CollectionPermission) => {
|
||||
if (permission) {
|
||||
onChange={async (
|
||||
permission: CollectionPermission | typeof EmptySelectValue
|
||||
) => {
|
||||
if (permission === EmptySelectValue) {
|
||||
await memberships.delete({
|
||||
collectionId: collection.id,
|
||||
userId: membership.userId,
|
||||
});
|
||||
} else {
|
||||
await memberships.create({
|
||||
collectionId: collection.id,
|
||||
userId: membership.userId,
|
||||
permission,
|
||||
});
|
||||
} else {
|
||||
await memberships.delete({
|
||||
collectionId: collection.id,
|
||||
userId: membership.userId,
|
||||
});
|
||||
}
|
||||
}}
|
||||
disabled={!can.update}
|
||||
|
||||
Reference in New Issue
Block a user