Allow the registration of optional locations via the catalog-client

This commit is contained in:
Dominik Henneke
2021-02-01 15:46:31 +01:00
parent 2132233fc8
commit 72b96e880c
3 changed files with 8 additions and 1 deletions
+5
View File
@@ -0,0 +1,5 @@
---
'@backstage/catalog-client': patch
---
Add the `presence` argument to the `CatalogApi` to be able to register optional locations.
+2 -1
View File
@@ -75,6 +75,7 @@ export class CatalogClient implements CatalogApi {
type = 'url',
target,
dryRun,
presence,
}: AddLocationRequest): Promise<AddLocationResponse> {
const response = await fetch(
`${await this.discoveryApi.getBaseUrl('catalog')}/locations${
@@ -85,7 +86,7 @@ export class CatalogClient implements CatalogApi {
'Content-Type': 'application/json',
},
method: 'POST',
body: JSON.stringify({ type, target }),
body: JSON.stringify({ type, target, presence }),
},
);
+1
View File
@@ -40,6 +40,7 @@ export type AddLocationRequest = {
type?: string;
target: string;
dryRun?: boolean;
presence?: 'optional' | 'required';
};
export type AddLocationResponse = {