0
0
Fork 0

refactor: refs #8207 improve logic

This commit is contained in:
Jorge Penadés 2024-11-22 15:49:07 +01:00
parent 661cc0b5ee
commit 9d8698fa2f
1 changed files with 5 additions and 5 deletions

View File

@ -130,19 +130,19 @@ const addFilter = async (filter, params) => {
await arrayData.addFilter({ filter, params });
};
async function fetch(params, keepRowsNumber = false) {
async function fetch(params, keepPagination = false) {
useArrayData(props.dataKey, params);
const { limit, skip } = arrayData.store;
if (keepRowsNumber) {
if (!keepPagination) await arrayData.fetch({ append: false });
else {
arrayData.store.limit = limit + skip;
arrayData.store.skip = 0;
}
await arrayData.fetch({ append: false });
if (keepRowsNumber) {
await arrayData.fetch({ append: false });
arrayData.store.limit = limit;
arrayData.store.skip = skip;
}
if (!store.hasMoreData) isLoading.value = false;
emit('onFetch', store.data);