Skip to content

Commit e1499e9

Browse files
fix(Nodes): request tablets only if required (#2433)
1 parent eccba69 commit e1499e9

File tree

2 files changed

+5
-14
lines changed

2 files changed

+5
-14
lines changed

src/containers/Nodes/getNodes.ts

Lines changed: 2 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -13,18 +13,9 @@ import {getRequiredDataFields} from '../../utils/tableUtils/getRequiredDataField
1313
export const getNodes: FetchData<
1414
NodesPreparedEntity,
1515
NodesFilters,
16-
Pick<NodesRequestParams, 'type' | 'storage' | 'tablets'>
16+
Pick<NodesRequestParams, 'type' | 'storage'>
1717
> = async (params) => {
18-
const {
19-
type = 'any',
20-
storage = false,
21-
tablets = true,
22-
limit,
23-
offset,
24-
sortParams,
25-
filters,
26-
columnsIds,
27-
} = params;
18+
const {type = 'any', storage = false, limit, offset, sortParams, filters, columnsIds} = params;
2819

2920
const {sortOrder, columnId} = sortParams ?? {};
3021
const {
@@ -46,7 +37,6 @@ export const getNodes: FetchData<
4637
const response = await window.api.viewer.getNodes({
4738
type,
4839
storage,
49-
tablets,
5040
limit,
5141
offset,
5242
sort,

src/services/api/viewer.ts

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -102,7 +102,7 @@ export class ViewerAPI extends BaseYdbAPI {
102102
getNodes(
103103
{
104104
type = 'any',
105-
tablets = false,
105+
tablets,
106106
database,
107107
tenant,
108108
fieldsRequired,
@@ -119,7 +119,8 @@ export class ViewerAPI extends BaseYdbAPI {
119119
this.getPath('/viewer/json/nodes?enums=true'),
120120
{
121121
type,
122-
tablets,
122+
// Use tablets for backward compatibility even if fieldsRequired is passed
123+
tablets: tablets ?? fieldsRequired?.includes('Tablets'),
123124
// Do not send empty string
124125
filter: filter || undefined,
125126
// TODO: remove after remove tenant param

0 commit comments

Comments
 (0)