Fix item loading on first open

This commit is contained in:
rijkvanzanten
2020-10-20 16:32:10 -04:00
parent ad14563651
commit 2d12e73871

View File

@@ -20,6 +20,8 @@ type Query = {
export function useItems(collection: Ref<string>, query: Query) {
const { primaryKeyField, sortField } = useCollection(collection);
let loadingTimeout: any = null;
const { limit, fields, sort, page, filters, searchQuery } = query;
const endpoint = computed(() => {
@@ -100,8 +102,6 @@ export function useItems(collection: Ref<string>, query: Query) {
}
});
let loadingTimeout: any = null;
return { itemCount, totalCount, items, totalPages, loading, error, changeManualSort, getItems };
async function getItems() {