From 695153eac9c71b3037c7464970e5c64cbb168a81 Mon Sep 17 00:00:00 2001
From: Julien Nahum
Date: Tue, 16 Jan 2024 17:44:50 +0100
Subject: [PATCH] Fix download submissions
---
.../open/forms/components/FormSubmissions.vue | 13 +++++++++++--
1 file changed, 11 insertions(+), 2 deletions(-)
diff --git a/client/components/open/forms/components/FormSubmissions.vue b/client/components/open/forms/components/FormSubmissions.vue
index 3cbf8dc..08b42db 100644
--- a/client/components/open/forms/components/FormSubmissions.vue
+++ b/client/components/open/forms/components/FormSubmissions.vue
@@ -60,9 +60,9 @@
href="javascript:void(0);" class="text-gray-500" @click="showColumnsModal=true"
>Display columns
-
+
Export as CSV
@@ -248,6 +248,15 @@ export default {
this.fullyLoaded = false
this.tableData = []
this.getSubmissionsData()
+ },
+ downloadAsCsv() {
+ opnFetch(this.exportUrl, { responseType: "blob" })
+ .then( blob => {
+ var file = window.URL.createObjectURL(blob);
+ window.location.assign(file);
+ }).catch((error)=>{
+ console.error(error)
+ })
}
}
}