Skip to content

Commit 27483f2

Browse files
authored
Merge pull request #189 from devforth/error-when-use-filters
Error when use filters
2 parents e296fe7 + b37f522 commit 27483f2

File tree

1 file changed

+7
-3
lines changed

1 file changed

+7
-3
lines changed

adminforth/spa/src/views/ListView.vue

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -178,9 +178,13 @@ const DEFAULT_PAGE_SIZE = 10;
178178
179179
const pageSize = computed(() => coreStore.resource?.options?.listPageSize || DEFAULT_PAGE_SIZE);
180180
181+
const isPageLoaded = ref(false);
181182
182183
async function getList() {
183184
rows.value = null;
185+
if (!isPageLoaded.value) {
186+
return;
187+
}
184188
const data = await callAdminForthApi({
185189
path: '/get_resource_data',
186190
method: 'POST',
@@ -434,9 +438,6 @@ watch([page], async () => {
434438
setQuery({ page: page.value });
435439
});
436440
437-
438-
439-
440441
watch([sort], async () => {
441442
if (!sort.value.length) {
442443
setQuery({ sort: undefined });
@@ -445,5 +446,8 @@ watch([sort], async () => {
445446
setQuery({ sort: SortQuerySerializer.serialize(sort.value) });
446447
});
447448
449+
watch(() => coreStore.resource, () => {
450+
isPageLoaded.value = true;
451+
});
448452
449453
</script>

0 commit comments

Comments
 (0)