fix: use currentFilter.limit when loadMore

This commit is contained in:
Javier Segarra 2024-09-13 10:58:17 +02:00
parent 23faa707bf
commit cf0b53c2bf
1 changed files with 5 additions and 1 deletions

View File

@ -234,8 +234,12 @@ export function useArrayData(key = useRoute().meta.moduleName, userOptions) {
async function loadMore() {
if (!store.hasMoreData) return;
const isCurrentFilter = JSON.parse(store.currentFilter.filter);
store.skip = store.limit * store.page;
const limit = isCurrentFilter
? isCurrentFilter.limit ?? store.limit
: store.limit;
store.skip = limit * store.page;
store.page += 1;
await fetch({ append: true });