Skip to content

fix: do not send empty strings in filters #1330

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Sep 23, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 10 additions & 3 deletions src/services/api.ts
Original file line number Diff line number Diff line change
Expand Up @@ -204,7 +204,8 @@ export class YdbEmbeddedAPI extends AxiosWrapper {
tablets = false,
database,
tenant,
fieldsRequired,
fieldsRequired = 'all',
filter,
...params
}: NodesRequestParams,
{concurrentId, signal}: AxiosOptions = {},
Expand All @@ -218,6 +219,8 @@ export class YdbEmbeddedAPI extends AxiosWrapper {
{
type,
tablets,
// Do not send empty string
filter: filter || undefined,
// TODO: remove after remove tenant param
database: database || tenant,
tenant: tenant || database,
Expand All @@ -228,7 +231,7 @@ export class YdbEmbeddedAPI extends AxiosWrapper {
);
}
getStorageInfo(
{tenant, database, nodeId, groupId, pDiskId, ...params}: StorageRequestParams,
{tenant, database, nodeId, groupId, pDiskId, filter, ...params}: StorageRequestParams,
{concurrentId, signal}: AxiosOptions = {},
) {
return this.get<TStorageInfo>(
Expand All @@ -239,13 +242,15 @@ export class YdbEmbeddedAPI extends AxiosWrapper {
node_id: nodeId,
group_id: groupId,
pdisk_id: pDiskId,
// Do not send empty string
filter: filter || undefined,
...params,
},
{concurrentId, requestConfig: {signal}},
);
}
getStorageGroups(
{nodeId, pDiskId, groupId, fieldsRequired = 'all', ...params}: GroupsRequestParams,
{nodeId, pDiskId, groupId, fieldsRequired = 'all', filter, ...params}: GroupsRequestParams,
{concurrentId, signal}: AxiosOptions = {},
) {
const preparedNodeId = Array.isArray(nodeId)
Expand All @@ -271,6 +276,8 @@ export class YdbEmbeddedAPI extends AxiosWrapper {
pdisk_id: preparedPDiskId,
group_id: preparedGroupId,
fields_required: preparedFieldsRequired,
// Do not send empty string
filter: filter || undefined,
...params,
},
{concurrentId, requestConfig: {signal}},
Expand Down
Loading