diff --git a/src/stores/admin/club/queryBuilder.ts b/src/stores/admin/club/queryBuilder.ts index 159a423..25a87e2 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"; }); }, - sendQuery(offset = 0, count = 25, query?: DynamicQueryStructure | string) { + async sendQuery(offset = 0, count = 25, query?: DynamicQueryStructure | string) { this.queryError = ""; if (offset == 0) { this.data = []; @@ -40,7 +40,7 @@ export const useQueryBuilderStore = defineStore("queryBuilder", { if (queryToSend == undefined || queryToSend == "" || (typeof queryToSend != "string" && queryToSend.table == "")) return; this.loadingData = "loading"; - http + await http .post(`/admin/querybuilder/query?offset=${offset}&count=${count}`, { query: queryToSend, }) @@ -65,7 +65,8 @@ export const useQueryBuilderStore = defineStore("queryBuilder", { this.queryError = ""; this.loadingData = "fetched"; }, - exportData() { + async exportData() { + await this.sendQuery(0, this.totalLength); if (this.data.length == 0) return; const csvString = [Object.keys(this.data[0]), ...this.data.map((d) => Object.values(d))] .map((e) => e.join(";"))