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) {
|
||||
if (params) applyParams(params);
|
||||
useArrayData(props.dataKey, params);
|
||||
arrayData.resetPagination();
|
||||
await arrayData.fetch({ append: false });
|
||||
return emitStoreData();
|
||||
}
|
||||
|
||||
async function update(params) {
|
||||
if (params) applyParams(params);
|
||||
useArrayData(props.dataKey, params);
|
||||
const { limit, skip } = store;
|
||||
store.limit = limit + skip;
|
||||
store.skip = 0;
|
||||
|
@ -163,12 +163,6 @@ async function update(params) {
|
|||
return emitStoreData();
|
||||
}
|
||||
|
||||
const applyParams = (params) => {
|
||||
for (let param in params) {
|
||||
if (params[param]) arrayData.store[param] = params[param];
|
||||
}
|
||||
};
|
||||
|
||||
function emitStoreData() {
|
||||
if (!store.hasMoreData) isLoading.value = false;
|
||||
emit('onFetch', store.data);
|
||||
|
|
Loading…
Reference in New Issue