add "init repository" checkbox to repository form

This commit is contained in:
Eduard Heimbuch
2020-01-17 13:56:42 +01:00
parent b8fb08a500
commit e2007d9e64
6 changed files with 65 additions and 23 deletions

View File

@@ -155,11 +155,12 @@ export function fetchRepoFailure(namespace: string, name: string, error: Error):
// create repo
export function createRepo(link: string, repository: Repository, callback?: (repo: Repository) => void) {
export function createRepo(link: string, repository: Repository, initRepository: boolean, callback?: (repo: Repository) => void) {
return function(dispatch: any) {
dispatch(createRepoPending());
const repoLink = initRepository ? link + "?initRepository=true" : link;
return apiClient
.post(link, repository, CONTENT_TYPE)
.post(repoLink, repository, CONTENT_TYPE)
.then(response => {
const location = response.headers.get("Location");
dispatch(createRepoSuccess());