Skip to content

Commit e3e30df

Browse files
committed
fix: add page load check to getList function
1 parent f7b0a94 commit e3e30df

File tree

1 file changed

+8
-3
lines changed

1 file changed

+8
-3
lines changed

adminforth/spa/src/views/ListView.vue

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -178,9 +178,14 @@ const DEFAULT_PAGE_SIZE = 10;
178178
179179
const pageSize = computed(() => coreStore.resource?.options?.listPageSize || DEFAULT_PAGE_SIZE);
180180
181+
let isPageLoaded = ref(false);
181182
182183
async function getList() {
183184
rows.value = null;
185+
if (!isPageLoaded.value) {
186+
return;
187+
}
188+
console.log('getListValidFilters', filtersStore.filers);
184189
const data = await callAdminForthApi({
185190
path: '/get_resource_data',
186191
method: 'POST',
@@ -434,9 +439,6 @@ watch([page], async () => {
434439
setQuery({ page: page.value });
435440
});
436441
437-
438-
439-
440442
watch([sort], async () => {
441443
if (!sort.value.length) {
442444
setQuery({ sort: undefined });
@@ -445,5 +447,8 @@ watch([sort], async () => {
445447
setQuery({ sort: SortQuerySerializer.serialize(sort.value) });
446448
});
447449
450+
watch(() => coreStore.resource, () => {
451+
isPageLoaded.value = true;
452+
});
448453
449454
</script>

0 commit comments

Comments
 (0)