Allow the registration of optional locations via the catalog-client
This commit is contained in:
@@ -0,0 +1,5 @@
|
||||
---
|
||||
'@backstage/catalog-client': patch
|
||||
---
|
||||
|
||||
Add the `presence` argument to the `CatalogApi` to be able to register optional locations.
|
||||
@@ -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 }),
|
||||
},
|
||||
);
|
||||
|
||||
|
||||
@@ -40,6 +40,7 @@ export type AddLocationRequest = {
|
||||
type?: string;
|
||||
target: string;
|
||||
dryRun?: boolean;
|
||||
presence?: 'optional' | 'required';
|
||||
};
|
||||
|
||||
export type AddLocationResponse = {
|
||||
|
||||
Reference in New Issue
Block a user