refactor: refs #8647 undo paginate changes
This commit is contained in:
parent
65a3582e79
commit
4f1c49afb3
|
@ -146,14 +146,14 @@ const addFilter = async (filter, params) => {
|
||||||
};
|
};
|
||||||
|
|
||||||
async function fetch(params) {
|
async function fetch(params) {
|
||||||
if (params) applyParams(params);
|
useArrayData(props.dataKey, params);
|
||||||
arrayData.resetPagination();
|
arrayData.resetPagination();
|
||||||
await arrayData.fetch({ append: false });
|
await arrayData.fetch({ append: false });
|
||||||
return emitStoreData();
|
return emitStoreData();
|
||||||
}
|
}
|
||||||
|
|
||||||
async function update(params) {
|
async function update(params) {
|
||||||
if (params) applyParams(params);
|
useArrayData(props.dataKey, params);
|
||||||
const { limit, skip } = store;
|
const { limit, skip } = store;
|
||||||
store.limit = limit + skip;
|
store.limit = limit + skip;
|
||||||
store.skip = 0;
|
store.skip = 0;
|
||||||
|
@ -163,12 +163,6 @@ async function update(params) {
|
||||||
return emitStoreData();
|
return emitStoreData();
|
||||||
}
|
}
|
||||||
|
|
||||||
const applyParams = (params) => {
|
|
||||||
for (let param in params) {
|
|
||||||
if (params[param]) arrayData.store[param] = params[param];
|
|
||||||
}
|
|
||||||
};
|
|
||||||
|
|
||||||
function emitStoreData() {
|
function emitStoreData() {
|
||||||
if (!store.hasMoreData) isLoading.value = false;
|
if (!store.hasMoreData) isLoading.value = false;
|
||||||
emit('onFetch', store.data);
|
emit('onFetch', store.data);
|
||||||
|
|
Loading…
Reference in New Issue