Skip to content

Commit

Permalink
fix: check member exist for invitation instance
Browse files Browse the repository at this point in the history
  • Loading branch information
LinaYahya committed Oct 12, 2023
1 parent f8bd2b6 commit e28fa3e
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions src/components/item/sharing/TableRowPermissionRenderer.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -54,9 +54,16 @@ function TableRowPermissionRenderer<
const onChangePermission: ItemMembershipSelectProps['onChange'] = (e) => {
const value = e.target.value as PermissionLevel;
// editing a parent's instance from a child should create a new instance
console.log({

Check warning on line 57 in src/components/item/sharing/TableRowPermissionRenderer.tsx

View workflow job for this annotation

GitHub Actions / build-and-test

Unexpected console statement

Check warning on line 57 in src/components/item/sharing/TableRowPermissionRenderer.tsx

View workflow job for this annotation

GitHub Actions / build-and-test

Unexpected console statement
value,
instancePer: instance.permission,
instanceMem: instance?.member?.id,
currentMember: currentMember?.id,
});
if (
(value === PermissionLevel.Read || value === PermissionLevel.Write) &&
instance.permission === PermissionLevel.Admin &&
instance?.member &&
instance?.member?.id === currentMember?.id
) {
setOpen(true);
Expand All @@ -65,6 +72,7 @@ function TableRowPermissionRenderer<
if (
value === PermissionLevel.Read &&
instance.permission === PermissionLevel.Write &&
instance?.member &&
instance?.member?.id === currentMember?.id
) {
setOpen(true);
Expand Down

0 comments on commit e28fa3e

Please sign in to comment.