mirror of
https://github.com/logto-io/logto.git
synced 2024-12-16 20:26:19 -05:00
fix(console): should navigate to details page after creating protected app (#5337)
This commit is contained in:
parent
7266aee445
commit
ecbec3d61a
1 changed files with 3 additions and 0 deletions
|
@ -14,6 +14,7 @@ import Button, { type Props as ButtonProps } from '@/ds-components/Button';
|
|||
import FormField from '@/ds-components/FormField';
|
||||
import TextInput from '@/ds-components/TextInput';
|
||||
import useApi from '@/hooks/use-api';
|
||||
import useTenantPathname from '@/hooks/use-tenant-pathname';
|
||||
|
||||
import * as styles from './index.module.scss';
|
||||
|
||||
|
@ -40,6 +41,7 @@ function ProtectedAppForm({
|
|||
isDevFeaturesEnabled && isCloud && 'api/systems/application'
|
||||
);
|
||||
const defaultDomain = data?.protectedApps.defaultDomain ?? '';
|
||||
const { navigate } = useTenantPathname();
|
||||
const { t } = useTranslation(undefined, { keyPrefix: 'admin_console' });
|
||||
const {
|
||||
register,
|
||||
|
@ -68,6 +70,7 @@ function ProtectedAppForm({
|
|||
.json<Application>();
|
||||
toast.success(t('applications.application_created'));
|
||||
onCreateSuccess?.(createdApp);
|
||||
navigate(`/applications/${createdApp.id}`);
|
||||
} catch (error: unknown) {
|
||||
if (error instanceof HTTPError) {
|
||||
const { code, message } = await error.response.json<RequestErrorBody>();
|
||||
|
|
Loading…
Reference in a new issue