mirror of
https://github.com/logto-io/logto.git
synced 2024-12-16 20:26:19 -05:00
fix(console): navigate to the details page on connector created (#2640)
This commit is contained in:
parent
e8ee2a31b1
commit
89651833d2
1 changed files with 4 additions and 1 deletions
|
@ -6,6 +6,7 @@ import i18next from 'i18next';
|
|||
import { FormProvider, useForm } from 'react-hook-form';
|
||||
import { toast } from 'react-hot-toast';
|
||||
import { useTranslation } from 'react-i18next';
|
||||
import { useNavigate } from 'react-router-dom';
|
||||
|
||||
import Close from '@/assets/images/close.svg';
|
||||
import Button from '@/components/Button';
|
||||
|
@ -30,6 +31,7 @@ type Props = {
|
|||
|
||||
const Guide = ({ connector, onClose }: Props) => {
|
||||
const api = useApi();
|
||||
const navigate = useNavigate();
|
||||
const { updateSettings } = useSettings();
|
||||
const { t } = useTranslation(undefined, { keyPrefix: 'admin_console' });
|
||||
const { id: connectorId, type: connectorType, name, readme, isStandard } = connector;
|
||||
|
@ -65,7 +67,7 @@ const Guide = ({ connector, onClose }: Props) => {
|
|||
|
||||
const { id: connectorId } = connector;
|
||||
|
||||
await api
|
||||
const createdConnector = await api
|
||||
.post('/api/connectors', {
|
||||
json: {
|
||||
config: result.data,
|
||||
|
@ -88,6 +90,7 @@ const Guide = ({ connector, onClose }: Props) => {
|
|||
|
||||
onClose();
|
||||
toast.success(t('general.saved'));
|
||||
navigate(`/connectors/${createdConnector.id}`);
|
||||
});
|
||||
|
||||
return (
|
||||
|
|
Loading…
Reference in a new issue