make baseUrl required in client constructor as it is required in configSchema
Signed-off-by: Colton Padden <colton.padden@fastmail.com>
This commit is contained in:
@@ -30,13 +30,12 @@ export class ApacheAirflowClient implements ApacheAirflowApi {
|
||||
discoveryApi: DiscoveryApi;
|
||||
baseUrl: string;
|
||||
|
||||
// TODO - need to better determine how to handle undefined baseUrl
|
||||
constructor({
|
||||
discoveryApi,
|
||||
baseUrl = 'http://localhost:8080',
|
||||
}: {
|
||||
discoveryApi: DiscoveryApi;
|
||||
baseUrl?: string;
|
||||
baseUrl: string;
|
||||
}) {
|
||||
this.discoveryApi = discoveryApi;
|
||||
this.baseUrl = baseUrl.endsWith('/') ? baseUrl : `${baseUrl}/`;
|
||||
|
||||
@@ -36,7 +36,7 @@ export const apacheAirflowPlugin = createPlugin({
|
||||
factory: ({ configApi, discoveryApi }) =>
|
||||
new ApacheAirflowClient({
|
||||
discoveryApi,
|
||||
baseUrl: configApi.getOptionalString('apacheAirflow.baseUrl'),
|
||||
baseUrl: configApi.getString('apacheAirflow.baseUrl'),
|
||||
}),
|
||||
}),
|
||||
],
|
||||
|
||||
Reference in New Issue
Block a user