mirror of
https://github.com/sourcebot-dev/sourcebot.git
synced 2025-12-12 20:35:24 +00:00
fix new connection complete callback route
This commit is contained in:
parent
fa0bb82921
commit
dc42a76e03
1 changed files with 6 additions and 3 deletions
|
|
@ -8,15 +8,18 @@ import {
|
|||
GerritConnectionCreationForm
|
||||
} from "@/app/[domain]/components/connectionCreationForms";
|
||||
import { useCallback } from "react";
|
||||
import { useDomain } from "@/hooks/useDomain";
|
||||
|
||||
export default function NewConnectionPage({
|
||||
params
|
||||
}: { params: { type: string } }) {
|
||||
const { type } = params;
|
||||
const domain = useDomain();
|
||||
const router = useRouter();
|
||||
|
||||
const onCreated = useCallback(() => {
|
||||
router.push('/connections');
|
||||
}, [router]);
|
||||
router.push(`/${domain}/connections`);
|
||||
}, [domain, router]);
|
||||
|
||||
if (type === 'github') {
|
||||
return <GitHubConnectionCreationForm onCreated={onCreated} />;
|
||||
|
|
@ -34,5 +37,5 @@ export default function NewConnectionPage({
|
|||
return <GerritConnectionCreationForm onCreated={onCreated} />;
|
||||
}
|
||||
|
||||
router.push('/connections');
|
||||
router.push(`/${domain}/connections`);
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in a new issue