Fixed blob handling

ref #19
This commit is contained in:
Nicolai Ort 2021-04-03 18:11:22 +02:00
parent f6334397dc
commit b938cfc49e
1 changed files with 5 additions and 1 deletions

View File

@ -330,11 +330,15 @@ function get_certificate() {
"distanceDonations": []
}]
axios.post(url, postdata)
axios.post(url, postdata, {
responseType: "blob"
})
.then((response) => {
console.log(response)
if (response.status != "200") {
toast.error("An error occured while generateing your certificate!");
} else {
var fileURL = window.URL.createObjectURL(new Blob([response.data]));
var fileURL = window.URL.createObjectURL(new Blob([response.data], { type: 'application/pdf' }));
var fileLink = document.createElement('a');
fileLink.href = fileURL;