fix: association filter (#1301)

* fix: pageSize 200 & not a function

* fix: filter params wrong
This commit is contained in:
anuoua 2022-12-30 20:04:04 +08:00 committed by GitHub
parent 07a01fc507
commit b80aec9733
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -35,8 +35,8 @@ export const SharedFilterContext = createContext<SharedFilterContextValue>({
}); });
export const concatFilter = (f1: SharedFilter, f2: SharedFilter): SharedFilter => { export const concatFilter = (f1: SharedFilter, f2: SharedFilter): SharedFilter => {
const newAnd = [f1.$and, f2.$and].filter((i) => i); const newAnd = [f1.$and, f2.$and].filter((i) => i).reduce((pre, cur) => pre.concat(cur), []);
const newOr = [f1.$or, f2.$or].filter((i) => i); const newOr = [f1.$or, f2.$or].filter((i) => i).reduce((pre, cur) => pre.concat(cur), []);
const newFilter: SharedFilter = {}; const newFilter: SharedFilter = {};
newAnd.length && (newFilter.$and = newAnd); newAnd.length && (newFilter.$and = newAnd);
newOr.length && (newFilter.$or = newOr); newOr.length && (newFilter.$or = newOr);