mirror of
https://github.com/nocobase/nocobase
synced 2024-11-15 08:21:53 +00:00
fix: fix T-2916 (#3393)
This commit is contained in:
parent
6fb5af993e
commit
8530da7c23
@ -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),
|
||||
},
|
||||
|
@ -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;
|
||||
}
|
||||
}
|
||||
|
@ -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();
|
||||
};
|
||||
|
Loading…
Reference in New Issue
Block a user