fix: fix T-2916 (#3393)

This commit is contained in:
YANG QIA 2024-01-15 23:46:29 +08:00 committed by GitHub
parent 6fb5af993e
commit 8530da7c23
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 7 additions and 6 deletions

View File

@ -115,7 +115,7 @@ export const ChartRendererProvider: React.FC<ChartRendererProps> = (props) => {
}),
{
defaultParams: [collection, query],
// Wait until CharrFilterProvider is rendered and check the status of the filter form
// Wait until ChartFilterProvider is rendered and check the status of the filter form
// since the filter parameters should be applied if the filter block is enabled
ready: ready && (!enabled || !!form),
},

View File

@ -111,7 +111,7 @@ export const removeUnparsableFilter = (filter: any) => {
const newLogic = {};
for (const key in filter) {
const value = removeUnparsableFilter(filter[key]);
if (value && !(typeof value === 'object' && Object.keys(value).length === 0)) {
if (value !== null && value !== undefined && !(typeof value === 'object' && Object.keys(value).length === 0)) {
newLogic[key] = value;
}
}

View File

@ -51,20 +51,21 @@ export const postProcess = async (ctx: Context, next: Next) => {
fieldMap: { [source: string]: { type?: string } };
};
ctx.body = data.map((record) => {
const result = {};
Object.entries(record).forEach(([key, value]) => {
if (!value) {
return;
}
const { type } = fieldMap[key] || {};
switch (type) {
case 'bigInt':
case 'integer':
case 'float':
case 'double':
value = Number(value);
record[key] = Number(value);
break;
}
result[key] = value;
});
return result;
return record;
});
await next();
};