1
1
import {
2
- AnyApiFactory ,
3
2
configApiRef ,
4
3
createApiFactory ,
5
4
createPlugin ,
@@ -9,36 +8,20 @@ import {
9
8
10
9
import { rootRouteRef } from './routes' ;
11
10
import { qetaApiRef , QetaClient } from './api' ;
12
- // import { catalogApiRef } from '@backstage/plugin-catalog-react';
13
- // import { CatalogClient } from '@backstage/catalog-client';
14
-
15
- const apiFactories : AnyApiFactory [ ] = [
16
- createApiFactory ( {
17
- api : qetaApiRef ,
18
- deps : { configApi : configApiRef , fetchApi : fetchApiRef } ,
19
- factory : ( { configApi, fetchApi } ) =>
20
- new QetaClient ( { configApi, fetchApi } ) ,
21
- } ) ,
22
- ] ;
23
-
24
- // TODO: Figure way to only add catalog api in local development
25
- // If this is enabled and used by a real backstage app, it will
26
- // die horribly with an error.
27
- /* const catalogApi = createApiFactory({
28
- api: catalogApiRef,
29
- deps: { discoveryApi: discoveryApiRef, fetchApi: fetchApiRef },
30
- factory: ({ discoveryApi, fetchApi }) =>
31
- new CatalogClient({ discoveryApi, fetchApi }),
32
- });
33
- apiFactories.push(catalogApi);
34
- */
35
11
36
12
export const qetaPlugin = createPlugin ( {
37
13
id : 'qeta' ,
38
14
routes : {
39
15
root : rootRouteRef ,
40
16
} ,
41
- apis : apiFactories ,
17
+ apis : [
18
+ createApiFactory ( {
19
+ api : qetaApiRef ,
20
+ deps : { configApi : configApiRef , fetchApi : fetchApiRef } ,
21
+ factory : ( { configApi, fetchApi } ) =>
22
+ new QetaClient ( { configApi, fetchApi } ) ,
23
+ } ) ,
24
+ ] ,
42
25
} ) ;
43
26
44
27
export const QetaPage = qetaPlugin . provide (
0 commit comments