From 2392cbf8eebb51aadb5480408fb69a0180551cac Mon Sep 17 00:00:00 2001 From: Patrik Oldsberg Date: Wed, 10 Feb 2021 12:58:19 +0100 Subject: [PATCH] catalog-import: removed bonus code --- .../src/api/CatalogImportClient.ts | 31 ------------------- 1 file changed, 31 deletions(-) diff --git a/plugins/catalog-import/src/api/CatalogImportClient.ts b/plugins/catalog-import/src/api/CatalogImportClient.ts index 6809404e62..16ad849d3c 100644 --- a/plugins/catalog-import/src/api/CatalogImportClient.ts +++ b/plugins/catalog-import/src/api/CatalogImportClient.ts @@ -161,37 +161,6 @@ export class CatalogImportClient implements CatalogImportApi { return payload.generateEntities.map((x: any) => x.entity); } - async createRepositoryLocation({ - location, - }: { - location: string; - }): Promise { - const idToken = await this.identityApi.getIdToken(); - const headers = { - 'Content-Type': 'application/json', - } as { [header: string]: string }; - if (idToken) { - headers.authorization = `Bearer ${idToken}`; - } - const response = await fetch( - `${await this.discoveryApi.getBaseUrl('catalog')}/locations`, - { - headers, - method: 'POST', - body: JSON.stringify({ - type: 'url', - target: location, - presence: 'optional', - }), - }, - ); - if (!response.ok) { - throw new Error( - `Received http response ${response.status}: ${response.statusText}`, - ); - } - } - // TODO: this response should better be part of the analyze-locations response and scm-independent / implemented per scm private async checkGitHubForExistingCatalogInfo({ url,