Skip to content

Commit 9e76ebc

Browse files
committed
Assign permission value in one spot
1 parent e4f5bf7 commit 9e76ebc

File tree

1 file changed

+2
-3
lines changed

1 file changed

+2
-3
lines changed

site/src/api/queries/organizations.ts

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -234,10 +234,9 @@ export const organizationsPermissions = (
234234
const orgId = key.substring(0, index);
235235
const perm = key.substring(index + 1);
236236
if (!acc[orgId]) {
237-
acc[orgId] = { [perm]: value };
238-
} else {
239-
acc[orgId][perm] = value;
237+
acc[orgId] = {};
240238
}
239+
acc[orgId][perm] = value;
241240
return acc;
242241
},
243242
{} as Record<string, AuthorizationResponse>,

0 commit comments

Comments
 (0)