Skip to content
Snippets Groups Projects
Commit 3d06f912 authored by robinwilliam.hundt's avatar robinwilliam.hundt
Browse files

Fix export button

parent e394339c
No related branches found
No related tags found
1 merge request!82Fix export button
Pipeline #
...@@ -62,7 +62,10 @@ ...@@ -62,7 +62,10 @@
}, },
methods: { methods: {
download () { download () {
ax.get('http://localhost:8000/api/export/csv/', {responseType: 'blob'}).then(response => { const url = process.env.NODE_ENV === 'production'
? `https://${window.location.host}${window.location.pathname}api/export/csv/`
: 'http://localhost:8000/api/export/csv/'
ax.get(url, {responseType: 'blob'}).then(response => {
console.log(response) console.log(response)
let blob = new Blob([response.data], { type: 'text/csv' }) let blob = new Blob([response.data], { type: 'text/csv' })
let url = window.URL.createObjectURL(blob) let url = window.URL.createObjectURL(blob)
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment