Skip to content
Snippets Groups Projects
Commit aeb2e98e authored by Timothee P's avatar Timothee P :sunflower:
Browse files

fetch blob instead of window.url to download file

parent 3ade3ac9
No related branches found
No related tags found
1 merge request!139REDMINE_ISSUE-12407
This commit is part of merge request !139. Comments created here will be created in the context of that merge request.
...@@ -340,15 +340,15 @@ export default { ...@@ -340,15 +340,15 @@ export default {
exportFeatures() { exportFeatures() {
const url = `${this.$store.state.configuration.VUE_APP_DJANGO_API_BASE}projects/${this.$route.params.slug}/feature-type/${this.$route.params.feature_type_slug}/export/`; const url = `${this.$store.state.configuration.VUE_APP_DJANGO_API_BASE}projects/${this.$route.params.slug}/feature-type/${this.$route.params.feature_type_slug}/export/`;
featureAPI featureAPI.getFeaturesBlob(url).then((blob) => {
.getFeaturesBlob(url) if (blob) {
.then((blob) => {
const link = document.createElement("a"); const link = document.createElement("a");
link.href = URL.createObjectURL(blob); link.href = URL.createObjectURL(blob);
link.download = `${this.project.title}-${this.structure.title}.json`; link.download = `${this.project.title}-${this.structure.title}.json`;
link.click(); link.click();
URL.revokeObjectURL(link.href); URL.revokeObjectURL(link.href);
}) }
});
}, },
}, },
......
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