Fixes broken link from User to UserOrg (#11759)

This commit is contained in:
Alex Corey
2022-02-22 16:34:30 -05:00
committed by GitHub
parent eb859b9812
commit fa47e48a15
3 changed files with 6 additions and 6 deletions

View File

@@ -20,7 +20,7 @@ const QS_CONFIG = getQSConfig('organizations', {
function UserOrganizationList() { function UserOrganizationList() {
const location = useLocation(); const location = useLocation();
const { id: userId } = useParams(); const { id } = useParams();
const { const {
result: { organizations, count, searchableKeys, relatedSearchableKeys }, result: { organizations, count, searchableKeys, relatedSearchableKeys },
@@ -36,8 +36,8 @@ function UserOrganizationList() {
}, },
actions, actions,
] = await Promise.all([ ] = await Promise.all([
UsersAPI.readOrganizations(userId, params), UsersAPI.readOrganizations(id, params),
UsersAPI.readOrganizationOptions(), UsersAPI.readOrganizationOptions(id),
]); ]);
return { return {
searchableKeys: Object.keys(actions.data.actions?.GET || {}).filter( searchableKeys: Object.keys(actions.data.actions?.GET || {}).filter(
@@ -49,7 +49,7 @@ function UserOrganizationList() {
organizations: results, organizations: results,
count: orgCount, count: orgCount,
}; };
}, [userId, location.search]), }, [id, location.search]),
{ {
organizations: [], organizations: [],
count: 0, count: 0,

View File

@@ -72,6 +72,6 @@ describe('<UserOrganizationlist />', () => {
page_size: 20, page_size: 20,
type: 'organization', type: 'organization',
}); });
expect(UsersAPI.readOrganizationOptions).toBeCalled(); expect(UsersAPI.readOrganizationOptions).toBeCalledWith('1');
}); });
}); });

View File

@@ -12,7 +12,7 @@ export default function UserOrganizationListItem({ organization }) {
> >
<Td id={labelId} dataLabel={t`Name`}> <Td id={labelId} dataLabel={t`Name`}>
<Link to={`/organizations/${organization.id}/details`} id={labelId}> <Link to={`/organizations/${organization.id}/details`} id={labelId}>
{organization.name} <b>{organization.name}</b>
</Link> </Link>
</Td> </Td>
<Td dataLabel={t`Description`}>{organization.description}</Td> <Td dataLabel={t`Description`}>{organization.description}</Td>