From e480b17edc5b212b71f564c8f2a7095eae73b460 Mon Sep 17 00:00:00 2001 From: Javier Segarra Date: Tue, 16 Jan 2024 07:24:41 +0100 Subject: [PATCH] refs #6704: fix2 --- src/composables/useArrayData.js | 14 +++++++++++++- src/pages/Worker/WorkerCreate.vue | 4 ++-- 2 files changed, 15 insertions(+), 3 deletions(-) diff --git a/src/composables/useArrayData.js b/src/composables/useArrayData.js index 9f66a0e89..d5c564373 100644 --- a/src/composables/useArrayData.js +++ b/src/composables/useArrayData.js @@ -142,10 +142,21 @@ export function useArrayData(key, userOptions) { userParams = sanitizerParams(userParams, store?.exprBuilder); store.userParams = userParams; - + store.skip = 0; await fetch({ append: false }); return { filter, params }; } + async function removeFilter({ filter, params }) { + if (filter) store.userFilter = Object.assign(store.userFilter, filter); + + let userParams = Object.assign({}, store.userParams, params); + userParams = sanitizerParams(userParams, store?.exprBuilder); + + store.userParams = userParams; + store.skip = 0; + await loadMore({ append: false }); + return { filter, params }; + } function sanitizerParams(params, exprBuilder) { for (const param in params) { @@ -200,6 +211,7 @@ export function useArrayData(key, userOptions) { fetch, applyFilter, addFilter, + removeFilter, refresh, destroy, loadMore, diff --git a/src/pages/Worker/WorkerCreate.vue b/src/pages/Worker/WorkerCreate.vue index accac7cf2..a476632bb 100644 --- a/src/pages/Worker/WorkerCreate.vue +++ b/src/pages/Worker/WorkerCreate.vue @@ -9,7 +9,7 @@ import VnInputDate from 'components/common/VnInputDate.vue'; import VnSelectFilter from 'src/components/common/VnSelectFilter.vue'; import VnSelectCreate from 'src/components/common/VnSelectCreate.vue'; import CreateBankEntityForm from 'src/components/CreateBankEntityForm.vue'; -import CustomerCreateNewPostcode from 'src/components/CreateNewPostcodeForm.vue'; +import CreateNewPostcode from 'src/components/CreateNewPostcodeForm.vue'; import VnInput from 'src/components/common/VnInput.vue'; import VnSubToolbar from 'src/components/ui/VnSubToolbar.vue'; @@ -189,7 +189,7 @@ onMounted(async () => { hide-selected >