0
0
Fork 0

perf: imrpove exprBuilder

This commit is contained in:
Javier Segarra 2024-09-19 12:06:00 +02:00
parent 46dbab4757
commit 8b379faa52
1 changed files with 1 additions and 2 deletions

View File

@ -183,8 +183,7 @@ async function fetchFilter(val) {
}, {}); }, {});
} else defaultWhere = { [key]: getVal(val) }; } else defaultWhere = { [key]: getVal(val) };
const where = { ...(val ? defaultWhere : {}), ...$props.where }; const where = { ...(val ? defaultWhere : {}), ...$props.where };
if (typeof $props.exprBuilder === 'function') $props.exprBuilder && Object.assign(where, $props.exprBuilder(key, val));
Object.assign(where, $props.exprBuilder(key, val));
const fetchOptions = { where, include, limit }; const fetchOptions = { where, include, limit };
if (fields) fetchOptions.fields = fields; if (fields) fetchOptions.fields = fields;
if (sortBy) fetchOptions.order = sortBy; if (sortBy) fetchOptions.order = sortBy;