From 9e8c967567e77016f4da4b07e6020338d34e3033 Mon Sep 17 00:00:00 2001 From: alexm Date: Wed, 11 Dec 2024 15:01:28 +0100 Subject: [PATCH] fix(VnSearchbar): hotFix rollback --- src/components/ui/VnSearchbar.vue | 23 +++++++++-------------- 1 file changed, 9 insertions(+), 14 deletions(-) diff --git a/src/components/ui/VnSearchbar.vue b/src/components/ui/VnSearchbar.vue index bdebfd875..4e90245d6 100644 --- a/src/components/ui/VnSearchbar.vue +++ b/src/components/ui/VnSearchbar.vue @@ -98,25 +98,20 @@ onMounted(() => { async function search() { const staticParams = Object.entries(store.userParams); arrayData.reset(['skip', 'page']); - let filter = { + + const filter = { params: { + ...Object.fromEntries(staticParams), search: searchText.value, }, + ...{ filter: props.filter }, }; - if (!searchText.value) { - filter = { - params: { - ...Object.fromEntries(staticParams), - }, - ...{ filter: props.filter }, - }; - if (props.whereFilter) { - filter.filter = { - where: props.whereFilter(searchText.value), - }; - delete filter.params.search; - } + if (props.whereFilter) { + filter.filter = { + where: props.whereFilter(searchText.value), + }; + delete filter.params.search; } await arrayData.applyFilter(filter); }