This commit is contained in:
Javier Segarra 2024-01-16 07:24:41 +01:00
parent 972c340fad
commit e480b17edc
2 changed files with 15 additions and 3 deletions

View File

@ -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,

View File

@ -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
>
<template #form>
<CustomerCreateNewPostcode
<CreateNewPostcode
@on-data-saved="onPostcodeCreated($event)"
/>
</template>