mirror of
https://github.com/scm-manager/scm-manager.git
synced 2025-11-12 16:35:45 +01:00
Pass down the repository type, because the RepositoryDto needs it for validation
This commit is contained in:
@@ -32,14 +32,15 @@ import { useHistory } from "react-router-dom";
|
|||||||
|
|
||||||
type Props = {
|
type Props = {
|
||||||
url: string;
|
url: string;
|
||||||
|
repositoryType: string;
|
||||||
setImportPending: (pending: boolean) => void;
|
setImportPending: (pending: boolean) => void;
|
||||||
};
|
};
|
||||||
|
|
||||||
const ImportRepositoryFromUrl: FC<Props> = ({ url, setImportPending }) => {
|
const ImportRepositoryFromUrl: FC<Props> = ({ url, repositoryType, setImportPending }) => {
|
||||||
const [repo, setRepo] = useState<RepositoryUrlImport>({
|
const [repo, setRepo] = useState<RepositoryUrlImport>({
|
||||||
name: "",
|
name: "",
|
||||||
namespace: "",
|
namespace: "",
|
||||||
type: "",
|
type: repositoryType,
|
||||||
contact: "",
|
contact: "",
|
||||||
description: "",
|
description: "",
|
||||||
importUrl: "",
|
importUrl: "",
|
||||||
|
|||||||
@@ -89,6 +89,7 @@ const ImportRepository: FC<Props> = ({
|
|||||||
return (
|
return (
|
||||||
<ImportRepositoryFromUrl
|
<ImportRepositoryFromUrl
|
||||||
url={((repositoryType!._links.import as Link[])!.find((link: Link) => link.name === "url") as Link).href}
|
url={((repositoryType!._links.import as Link[])!.find((link: Link) => link.name === "url") as Link).href}
|
||||||
|
repositoryType={repositoryType!.name}
|
||||||
setImportPending={setImportPending}
|
setImportPending={setImportPending}
|
||||||
/>
|
/>
|
||||||
);
|
);
|
||||||
|
|||||||
Reference in New Issue
Block a user