From c2333c9455b90395ac09d956ec901f0821b27724 Mon Sep 17 00:00:00 2001 From: jorgep Date: Wed, 3 Jul 2024 17:53:37 +0200 Subject: [PATCH] chore: refs #7300 reset arrayData --- src/components/ui/VnFilterPanel.vue | 8 ++------ src/components/ui/VnPaginate.vue | 7 ++++--- src/components/ui/VnSearchbar.vue | 3 +-- src/composables/useArrayData.js | 9 ++++----- src/stores/useArrayDataStore.js | 23 ++++++++++++++++------- 5 files changed, 27 insertions(+), 23 deletions(-) diff --git a/src/components/ui/VnFilterPanel.vue b/src/components/ui/VnFilterPanel.vue index 5595d54ba..2ea51ed8b 100644 --- a/src/components/ui/VnFilterPanel.vue +++ b/src/components/ui/VnFilterPanel.vue @@ -112,9 +112,7 @@ async function search(evt) { isLoading.value = true; const filter = { ...userParams.value }; store.userParamsChanged = true; - store.filter.skip = 0; - store.skip = 0; - store.page = 1; + arrayData.reset(['skip', 'filter.skip', 'page']); const { params: newParams } = await arrayData.addFilter({ params: userParams.value }); userParams.value = newParams; @@ -138,9 +136,7 @@ async function reload() { async function clearFilters() { isLoading.value = true; store.userParamsChanged = true; - store.filter.skip = 0; - store.skip = 0; - store.page = 1; + arrayData.reset(['skip', 'filter.skip', 'page']); // Filtrar los params no removibles const removableFilters = Object.keys(userParams.value).filter((param) => $props.unremovableParams.includes(param) diff --git a/src/components/ui/VnPaginate.vue b/src/components/ui/VnPaginate.vue index 9a2c06b0c..8e426b471 100644 --- a/src/components/ui/VnPaginate.vue +++ b/src/components/ui/VnPaginate.vue @@ -1,5 +1,5 @@