Skip to content

Commit

Permalink
refactor: Return lookup from selector
Browse files Browse the repository at this point in the history
  • Loading branch information
David Code Howard committed Nov 1, 2023
1 parent 00faf6e commit 53b2094
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
8 changes: 4 additions & 4 deletions src/selectors.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -203,9 +203,9 @@ test('select user sites with project role', () => {

const roles = selectSitesAndUserRoles(store.getState(), user.id);
expect(roles).toStrictEqual({
[site1.id]: [site1, 'manager'],
[site2.id]: [site2, 'contributor'],
[site3.id]: [site3, undefined],
[site4.id]: [site4, 'contributor'],
[site1.id]: 'manager',
[site2.id]: 'contributor',
[site3.id]: undefined,
[site4.id]: 'contributor',
});
});
2 changes: 1 addition & 1 deletion src/selectors.ts
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ export const selectSitesAndUserRoles = createSelector(
if (site.projectId !== undefined) {
role = userRoleMap[site.projectId];
}
return [site.id, [site, role]];
return [site.id, role];
}),
);
},
Expand Down

0 comments on commit 53b2094

Please sign in to comment.