mirror of
https://github.com/sourcebot-dev/sourcebot.git
synced 2025-12-16 22:35:34 +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
|
GerritConnectionCreationForm
|
||||||
} from "@/app/[domain]/components/connectionCreationForms";
|
} from "@/app/[domain]/components/connectionCreationForms";
|
||||||
import { useCallback } from "react";
|
import { useCallback } from "react";
|
||||||
|
import { useDomain } from "@/hooks/useDomain";
|
||||||
|
|
||||||
export default function NewConnectionPage({
|
export default function NewConnectionPage({
|
||||||
params
|
params
|
||||||
}: { params: { type: string } }) {
|
}: { params: { type: string } }) {
|
||||||
const { type } = params;
|
const { type } = params;
|
||||||
|
const domain = useDomain();
|
||||||
const router = useRouter();
|
const router = useRouter();
|
||||||
|
|
||||||
const onCreated = useCallback(() => {
|
const onCreated = useCallback(() => {
|
||||||
router.push('/connections');
|
router.push(`/${domain}/connections`);
|
||||||
}, [router]);
|
}, [domain, router]);
|
||||||
|
|
||||||
if (type === 'github') {
|
if (type === 'github') {
|
||||||
return <GitHubConnectionCreationForm onCreated={onCreated} />;
|
return <GitHubConnectionCreationForm onCreated={onCreated} />;
|
||||||
|
|
@ -34,5 +37,5 @@ export default function NewConnectionPage({
|
||||||
return <GerritConnectionCreationForm onCreated={onCreated} />;
|
return <GerritConnectionCreationForm onCreated={onCreated} />;
|
||||||
}
|
}
|
||||||
|
|
||||||
router.push('/connections');
|
router.push(`/${domain}/connections`);
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue