Skip to content
This repository was archived by the owner on Feb 24, 2023. It is now read-only.

Commit a74c0e4

Browse files
authored
Merge pull request #89 from scale8/redirect-after-ownership-tranfer
Redirect to user list after ownership transfer
2 parents 79facd6 + b049ca5 commit a74c0e4

File tree

1 file changed

+9
-2
lines changed

1 file changed

+9
-2
lines changed

ui/src/dialogPages/global/OrgTransferOwnership.tsx

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,9 +13,13 @@ import { FormValidationResult } from '../../hooks/form/useFormValidation';
1313
import { ApolloError } from '@apollo/client/errors';
1414
import OrgTransferOwnershipForm from '../../components/organisms/Forms/OrgTransferOwnershipForm';
1515
import { DialogPreloadForm, DialogPreloadFormProps } from '../abstractions/DialogPreloadForm';
16+
import { toOrg } from '../../utils/NavigationPaths';
17+
import { useRouter } from 'next/router';
1618

1719
const OrgTransferOwnership: FC<DialogPageProps> = (props: DialogPageProps) => {
18-
const duplicateProps: DialogPreloadFormProps<
20+
const router = useRouter();
21+
22+
const transferProps: DialogPreloadFormProps<
1923
OrgTransferOwnershipGetData,
2024
OrgTransferOwnershipValues,
2125
OrgTransferOwnershipFormProps,
@@ -64,7 +68,10 @@ const OrgTransferOwnership: FC<DialogPageProps> = (props: DialogPageProps) => {
6468
OrgTransferOwnershipFormProps,
6569
OrgTransferOwnershipResult
6670
>
67-
{...duplicateProps}
71+
{...transferProps}
72+
pageRefresh={() => {
73+
router.push(toOrg({ id: props.id }, 'users')).then();
74+
}}
6875
/>
6976
);
7077
};

0 commit comments

Comments
 (0)