Skip to content

Commit

Permalink
Sharedbucket bugfix non-duplicates (#166)
Browse files Browse the repository at this point in the history
  • Loading branch information
ssb-jnk authored Mar 22, 2024
1 parent 247fc68 commit dc2d284
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions src/pages/SharedBucketDetail/SharedBucketDetail.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -43,10 +43,11 @@ const SharedBucketDetail = () => {
}
} = {}

;(response['sharedBucket'] as SharedBucket).groups.forEach(({ uniform_name, users }) => {
;((response['sharedBucket'] as SharedBucket).groups ?? []).forEach(({ uniform_name, users }) => {
;(users ?? []).forEach((user) => {
if (!usersMap[user.principal_name]) {
usersMap[user.principal_name] = {
const key = `${user.principal_name}-${stripSuffixes(uniform_name)}`
if (!usersMap[key]) {
usersMap[key] = {
id: formatDisplayName(user.display_name),
navn: (
<FormattedTableColumn
Expand All @@ -66,7 +67,7 @@ const SharedBucketDetail = () => {
),
}
} else {
usersMap[user.principal_name].gruppe.push(getGroupType(uniform_name))
usersMap[key].gruppe.push(getGroupType(uniform_name))
}
})
})
Expand Down

0 comments on commit dc2d284

Please sign in to comment.