From 8b379faa52758aad7301bedb777fa83727965283 Mon Sep 17 00:00:00 2001 From: Javier Segarra Date: Thu, 19 Sep 2024 12:06:00 +0200 Subject: [PATCH] perf: imrpove exprBuilder --- src/components/common/VnSelect.vue | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/src/components/common/VnSelect.vue b/src/components/common/VnSelect.vue index cd5608954..aa629767d 100644 --- a/src/components/common/VnSelect.vue +++ b/src/components/common/VnSelect.vue @@ -183,8 +183,7 @@ async function fetchFilter(val) { }, {}); } else defaultWhere = { [key]: getVal(val) }; const where = { ...(val ? defaultWhere : {}), ...$props.where }; - if (typeof $props.exprBuilder === 'function') - Object.assign(where, $props.exprBuilder(key, val)); + $props.exprBuilder && Object.assign(where, $props.exprBuilder(key, val)); const fetchOptions = { where, include, limit }; if (fields) fetchOptions.fields = fields; if (sortBy) fetchOptions.order = sortBy;