From 4821be0c8cb4d8ecaa0904cd34afebfde413acac Mon Sep 17 00:00:00 2001 From: Julian Krauser Date: Sun, 16 Feb 2025 13:32:20 +0100 Subject: [PATCH] change: query builder fetch all on download --- src/stores/admin/club/queryBuilder.ts | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/stores/admin/club/queryBuilder.ts b/src/stores/admin/club/queryBuilder.ts index 5070a8d..d70cd66 100644 --- a/src/stores/admin/club/queryBuilder.ts +++ b/src/stores/admin/club/queryBuilder.ts @@ -30,7 +30,7 @@ export const useQueryBuilderStore = defineStore("queryBuilder", { this.loading = "failed"; }); }, - async sendQuery(offset = 0, count = 25, query?: DynamicQueryStructure | string) { + async sendQuery(offset = 0, count = 25, query?: DynamicQueryStructure | string, noLimit: boolean = false) { this.queryError = ""; if (offset == 0) { this.data = []; @@ -41,7 +41,7 @@ export const useQueryBuilderStore = defineStore("queryBuilder", { return; this.loadingData = "loading"; await http - .post(`/admin/querybuilder/query?offset=${offset}&count=${count}`, { + .post(`/admin/querybuilder/query?` + (noLimit ? `noLimit=true` : `offset=${offset}&count=${count}`), { query: queryToSend, }) .then((result) => { @@ -66,7 +66,7 @@ export const useQueryBuilderStore = defineStore("queryBuilder", { this.loadingData = "fetched"; }, async exportData() { - await this.sendQuery(0, this.totalLength); + await this.sendQuery(0, 0, undefined, true); if (this.data.length == 0) return; const csvString = [Object.keys(this.data[0]), ...this.data.map((d) => Object.values(d))] .map((e) => e.join(";"))