fix: data scope linkage in association field (#2786)

This commit is contained in:
katherinehhh 2023-10-10 20:01:08 +08:00 committed by GitHub
parent 9085f5ca20
commit 59f74326b4
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 2 additions and 4 deletions

View File

@ -67,7 +67,7 @@ export default function useServiceOptions(props) {
const _run = async () => { const _run = async () => {
const result = await parseFilter(mergeFilter([filterFromSchema || service?.params?.filter])); const result = await parseFilter(mergeFilter([filterFromSchema || service?.params?.filter]));
setFieldServiceFilter(removeNullCondition(result)); setFieldServiceFilter(result);
}; };
const run = _.debounce(_run, DEBOUNCE_WAIT); const run = _.debounce(_run, DEBOUNCE_WAIT);

View File

@ -36,17 +36,15 @@ const useParseDataScopeFilter = ({ exclude }: Props = { exclude: defaultExclude
return result; return result;
}, },
}); });
await Promise.all( await Promise.all(
Object.keys(flat).map(async (key) => { Object.keys(flat).map(async (key) => {
flat[key] = await flat[key]; flat[key] = await flat[key];
if (flat[key] === undefined) { if (flat[key] === undefined) {
delete flat[key]; flat[key] = null;
} }
return flat[key]; return flat[key];
}), }),
); );
const result = unflatten(flat); const result = unflatten(flat);
return result; return result;
}, },