Skip to content

Commit b4fff7a

Browse files
committed
fix: getpath for meta
1 parent 573b9e5 commit b4fff7a

File tree

1 file changed

+8
-4
lines changed

1 file changed

+8
-4
lines changed

src/services/api/meta.ts

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -13,15 +13,19 @@ import type {AxiosOptions} from './base';
1313
import {BaseYdbAPI} from './base';
1414

1515
export class MetaAPI extends BaseYdbAPI {
16+
getPath(path: string) {
17+
return `${META_BACKEND ?? ''}${path}`;
18+
}
19+
1620
getClustersList(_?: never, {signal}: {signal?: AbortSignal} = {}) {
17-
return this.get<MetaClusters>(`${META_BACKEND || ''}/meta/clusters`, null, {
21+
return this.get<MetaClusters>(this.getPath('/meta/clusters'), null, {
1822
requestConfig: {signal},
1923
});
2024
}
2125

2226
getClusterInfo(clusterName?: string, {signal}: AxiosOptions = {}) {
2327
return this.get<MetaCluster>(
24-
`${META_BACKEND || ''}/meta/cluster`,
28+
this.getPath('/meta/cluster'),
2529
{
2630
name: clusterName,
2731
},
@@ -31,7 +35,7 @@ export class MetaAPI extends BaseYdbAPI {
3135

3236
getTenants(clusterName?: string, {signal}: AxiosOptions = {}) {
3337
return this.get<MetaTenants>(
34-
`${META_BACKEND || ''}/meta/cp_databases`,
38+
this.getPath('/meta/cp_databases'),
3539
{
3640
cluster_name: clusterName,
3741
},
@@ -44,7 +48,7 @@ export class MetaAPI extends BaseYdbAPI {
4448
{concurrentId, signal}: AxiosOptions = {},
4549
): Promise<MetaBaseClusterInfo> {
4650
return this.get<MetaBaseClusters>(
47-
`${META_BACKEND || ''}/meta/db_clusters`,
51+
this.getPath('/meta/db_clusters'),
4852
{
4953
name: clusterName,
5054
},

0 commit comments

Comments
 (0)