diff --git a/src/components/ui/VnSearchbar.vue b/src/components/ui/VnSearchbar.vue index ccf87c6d6..bdebfd875 100644 --- a/src/components/ui/VnSearchbar.vue +++ b/src/components/ui/VnSearchbar.vue @@ -51,10 +51,6 @@ const props = defineProps({ type: Object, default: null, }, - staticParams: { - type: Array, - default: () => [], - }, exprBuilder: { type: Function, default: null, @@ -102,20 +98,25 @@ onMounted(() => { async function search() { const staticParams = Object.entries(store.userParams); arrayData.reset(['skip', 'page']); - - const filter = { + let filter = { params: { - ...Object.fromEntries(staticParams), search: searchText.value, }, - ...{ filter: props.filter }, }; - - if (props.whereFilter) { - filter.filter = { - where: props.whereFilter(searchText.value), + if (!searchText.value) { + filter = { + params: { + ...Object.fromEntries(staticParams), + }, + ...{ filter: props.filter }, }; - delete filter.params.search; + + if (props.whereFilter) { + filter.filter = { + where: props.whereFilter(searchText.value), + }; + delete filter.params.search; + } } await arrayData.applyFilter(filter); } diff --git a/src/pages/Ticket/TicketList.vue b/src/pages/Ticket/TicketList.vue index 2fe4fcddc..eb03a4927 100644 --- a/src/pages/Ticket/TicketList.vue +++ b/src/pages/Ticket/TicketList.vue @@ -1,6 +1,6 @@