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
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 6 additions and 6 deletions

View File

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

View File

@ -72,6 +72,6 @@ describe('<UserOrganizationlist />', () => {
page_size: 20,
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`}>
<Link to={`/organizations/${organization.id}/details`} id={labelId}>
{organization.name}
<b>{organization.name}</b>
</Link>
</Td>
<Td dataLabel={t`Description`}>{organization.description}</Td>