Skip to content

Commit c958893

Browse files
authored
feat(api): support object path manipulation (#2786)
1 parent 4cfdcf6 commit c958893

File tree

2 files changed

+16
-12
lines changed

2 files changed

+16
-12
lines changed

src/services/api/base.ts

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -77,6 +77,10 @@ export class BaseYdbAPI extends AxiosWrapper {
7777
return `${BACKEND ?? ''}${path}`;
7878
}
7979

80+
getSchemaPath(props: {path?: string; database?: string}) {
81+
return props.path;
82+
}
83+
8084
prepareArrayRequestParam(arr: (string | number)[]) {
8185
return arr.join(',');
8286
}

src/services/api/viewer.ts

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -147,7 +147,7 @@ export class ViewerAPI extends BaseYdbAPI {
147147
{
148148
database,
149149
node_id: nodeId,
150-
path,
150+
path: this.getSchemaPath({path, database}),
151151
enums: true,
152152
filter,
153153
},
@@ -163,7 +163,7 @@ export class ViewerAPI extends BaseYdbAPI {
163163
this.getPath('/viewer/json/describe'),
164164
{
165165
database,
166-
path,
166+
path: this.getSchemaPath({path, database}),
167167
enums: true,
168168
backup: false,
169169
private: true,
@@ -184,7 +184,7 @@ export class ViewerAPI extends BaseYdbAPI {
184184
this.getPath('/viewer/json/describe'),
185185
{
186186
database,
187-
path,
187+
path: this.getSchemaPath({path, database}),
188188
enums: true,
189189
partition_stats: true,
190190
subs: 0,
@@ -201,7 +201,7 @@ export class ViewerAPI extends BaseYdbAPI {
201201
this.getPath('/viewer/json/acl'),
202202
{
203203
database,
204-
path,
204+
path: this.getSchemaPath({path, database}),
205205
merge_rules: true,
206206
dialect,
207207
},
@@ -216,7 +216,7 @@ export class ViewerAPI extends BaseYdbAPI {
216216
this.getPath('/viewer/json/acl'),
217217
{
218218
database,
219-
path,
219+
path: this.getSchemaPath({path, database}),
220220
merge_rules: true,
221221
dialect,
222222
list_permissions: true,
@@ -238,7 +238,7 @@ export class ViewerAPI extends BaseYdbAPI {
238238
rights,
239239
{
240240
database,
241-
path,
241+
path: this.getSchemaPath({path, database}),
242242
merge_rules: true,
243243
dialect,
244244
},
@@ -254,7 +254,7 @@ export class ViewerAPI extends BaseYdbAPI {
254254
this.getPath('/viewer/json/describe'),
255255
{
256256
database,
257-
path,
257+
path: this.getSchemaPath({path, database}),
258258
enums: true,
259259
backup: false,
260260
children: false,
@@ -274,7 +274,7 @@ export class ViewerAPI extends BaseYdbAPI {
274274
{
275275
enums: true,
276276
database,
277-
path,
277+
path: this.getSchemaPath({path, database}),
278278
},
279279
{concurrentId, requestConfig: {signal}},
280280
);
@@ -290,7 +290,7 @@ export class ViewerAPI extends BaseYdbAPI {
290290
enums: true,
291291
include_stats: true,
292292
database,
293-
path,
293+
path: this.getSchemaPath({path, database}),
294294
},
295295
{concurrentId, requestConfig: {signal}},
296296
);
@@ -306,7 +306,7 @@ export class ViewerAPI extends BaseYdbAPI {
306306
enums: true,
307307
include_stats: true,
308308
database,
309-
path,
309+
path: this.getSchemaPath({path, database}),
310310
},
311311
{concurrentId, requestConfig: {signal}},
312312
);
@@ -329,7 +329,7 @@ export class ViewerAPI extends BaseYdbAPI {
329329
enums: true,
330330
include_stats: true,
331331
database,
332-
path,
332+
path: this.getSchemaPath({path, database}),
333333
consumer,
334334
},
335335
{concurrentId: concurrentId || 'getConsumer', requestConfig: {signal}},
@@ -438,7 +438,7 @@ export class ViewerAPI extends BaseYdbAPI {
438438
this.getPath('/viewer/json/hotkeys'),
439439
{
440440
database,
441-
path,
441+
path: this.getSchemaPath({path, database}),
442442
enable_sampling: enableSampling,
443443
},
444444
{concurrentId: concurrentId || 'getHotKeys', requestConfig: {signal}},

0 commit comments

Comments
 (0)