From ae4bdb74a278021c224928ac220f5409b01f5855 Mon Sep 17 00:00:00 2001 From: Ryan Pandya Date: Thu, 27 Jul 2023 13:21:05 -0700 Subject: [PATCH] Fix limit>100 bug --- lifetracker-vue/src/services/appwrite.js | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/lifetracker-vue/src/services/appwrite.js b/lifetracker-vue/src/services/appwrite.js index 4dc57c6..0ae5992 100644 --- a/lifetracker-vue/src/services/appwrite.js +++ b/lifetracker-vue/src/services/appwrite.js @@ -84,7 +84,8 @@ class AppwriteService { var documents = []; // Start with nothing loaded var limit = 100; - while(limit > 0){ // Make repeated requests until we hit the numEntries + while(limit > 0){ + // Make repeated requests until we hit the numEntries let newEntries = (await this.database.listDocuments( this.databaseId, this.collectionId, [ Query.orderAsc("date"), @@ -96,7 +97,8 @@ class AppwriteService { documents = documents.flat(); offset += limit; // Increment offset by the amount we just loaded - limit = numEntries - offset; // This might not work + limit = numEntries - offset; + if(limit > 100){ limit = 100} // This might not work // console.log(numEntries + " entries; offset " + offset + "; limit " + limit); };