#8207 hotfix-tableActions #991

Merged
jorgep merged 11 commits from 8207-hotfix-tableActions into master 2024-11-25 11:13:45 +00:00
1 changed files with 1 additions and 1 deletions
Showing only changes of commit 8b52629b0b - Show all commits

View File

@ -132,10 +132,10 @@ const addFilter = async (filter, params) => {
async function fetch(params, keepPagination = false) {
jorgep marked this conversation as resolved Outdated
Outdated
Review

Yo haria algo mas asi:

async function fetch(params) {
    useArrayData(props.dataKey, params);
    arrayData.reset(['filter.skip', 'skip']);
    await arrayData.fetch({ append: false });

    endFetch();
}

async function refresh(params) {
    useArrayData(props.dataKey, params);

    const { limit, skip } = store;
    store.limit = limit + skip;
    store.skip = 0;
    await arrayData.fetch({ append: false });
    store.limit = limit;
    store.skip = skip;

    endFetch();
}

function endFetch() {
    if (!store.hasMoreData) isLoading.value = false;

    emit('onFetch', store.data);
    return store.data;
}
Yo haria algo mas asi: ``` async function fetch(params) { useArrayData(props.dataKey, params); arrayData.reset(['filter.skip', 'skip']); await arrayData.fetch({ append: false }); endFetch(); } async function refresh(params) { useArrayData(props.dataKey, params); const { limit, skip } = store; store.limit = limit + skip; store.skip = 0; await arrayData.fetch({ append: false }); store.limit = limit; store.skip = skip; endFetch(); } function endFetch() { if (!store.hasMoreData) isLoading.value = false; emit('onFetch', store.data); return store.data; } ```
useArrayData(props.dataKey, params);
const { limit, skip } = arrayData.store;
if (!keepPagination) await arrayData.fetch({ append: false });
else {
const { limit, skip } = store;
store.limit = limit + skip;
store.skip = 0;
await arrayData.fetch({ append: false });