Error message on pdf generation fail

ref #62
This commit is contained in:
Nicolai Ort 2021-02-20 17:25:48 +01:00
parent 4ece21cdf2
commit 12bcbd28f3
7 changed files with 314 additions and 247 deletions

View File

@ -136,7 +136,18 @@
body: JSON.stringify(runners), body: JSON.stringify(runners),
} }
) )
.then((response) => response.blob()) .then((response) => {
if (response.status != '200') {
const toast = Toastify({
text: $_('pdf-generation-failed'),
duration: 1000,
backgroundColor:
'linear-gradient(90deg, hsla(281, 37%, 45%, 1) 0%, hsla(1, 62%, 48%, 1) 100%)',
}).showToast();
} else {
return response.blob();
}
})
.then((blob) => { .then((blob) => {
const url = window.URL.createObjectURL(blob); const url = window.URL.createObjectURL(blob);
let a = document.createElement('a'); let a = document.createElement('a');

View File

@ -66,7 +66,18 @@
body: JSON.stringify(runners), body: JSON.stringify(runners),
} }
) )
.then((response) => response.blob()) .then((response) => {
if (response.status != '200') {
const toast = Toastify({
text: $_('pdf-generation-failed'),
duration: 1000,
backgroundColor:
'linear-gradient(90deg, hsla(281, 37%, 45%, 1) 0%, hsla(1, 62%, 48%, 1) 100%)',
}).showToast();
} else {
return response.blob();
}
})
.then((blob) => { .then((blob) => {
count++; count++;
const url = window.URL.createObjectURL(blob); const url = window.URL.createObjectURL(blob);

View File

@ -149,7 +149,18 @@
body: JSON.stringify([original_data_pdf]), body: JSON.stringify([original_data_pdf]),
} }
) )
.then((response) => response.blob()) .then((response) => {
if (response.status != '200') {
const toast = Toastify({
text: $_('pdf-generation-failed'),
duration: 1000,
backgroundColor:
'linear-gradient(90deg, hsla(281, 37%, 45%, 1) 0%, hsla(1, 62%, 48%, 1) 100%)',
}).showToast();
} else {
return response.blob();
}
})
.then((blob) => { .then((blob) => {
const url = window.URL.createObjectURL(blob); const url = window.URL.createObjectURL(blob);
let a = document.createElement('a'); let a = document.createElement('a');

View File

@ -97,7 +97,18 @@
), ),
} }
) )
.then((response) => response.blob()) .then((response) => {
if (response.status != '200') {
const toast = Toastify({
text: $_('pdf-generation-failed'),
duration: 1000,
backgroundColor:
'linear-gradient(90deg, hsla(281, 37%, 45%, 1) 0%, hsla(1, 62%, 48%, 1) 100%)',
}).showToast();
} else {
return response.blob();
}
})
.then((blob) => { .then((blob) => {
const url = window.URL.createObjectURL(blob); const url = window.URL.createObjectURL(blob);
let a = document.createElement('a'); let a = document.createElement('a');

View File

@ -118,7 +118,18 @@
body: JSON.stringify(runners), body: JSON.stringify(runners),
} }
) )
.then((response) => response.blob()) .then((response) => {
if (response.status != '200') {
const toast = Toastify({
text: $_('pdf-generation-failed'),
duration: 1000,
backgroundColor:
'linear-gradient(90deg, hsla(281, 37%, 45%, 1) 0%, hsla(1, 62%, 48%, 1) 100%)',
}).showToast();
} else {
return response.blob();
}
})
.then((blob) => { .then((blob) => {
const url = window.URL.createObjectURL(blob); const url = window.URL.createObjectURL(blob);
let a = document.createElement('a'); let a = document.createElement('a');

View File

@ -68,7 +68,18 @@
body: JSON.stringify(runners), body: JSON.stringify(runners),
} }
) )
.then((response) => response.blob()) .then((response) => {
if (response.status != '200') {
const toast = Toastify({
text: $_('pdf-generation-failed'),
duration: 1000,
backgroundColor:
'linear-gradient(90deg, hsla(281, 37%, 45%, 1) 0%, hsla(1, 62%, 48%, 1) 100%)',
}).showToast();
} else {
return response.blob();
}
})
.then((blob) => { .then((blob) => {
const url = window.URL.createObjectURL(blob); const url = window.URL.createObjectURL(blob);
let a = document.createElement('a'); let a = document.createElement('a');

View File

@ -238,5 +238,6 @@
"verfuegbare": "verfügbare", "verfuegbare": "verfügbare",
"welcome_wavinghand": "Willkommen 👋", "welcome_wavinghand": "Willkommen 👋",
"you-can-now-use-your-new-password-to-log-in-to-your-account": "Du kannst dich jetzt mit deinem neuen Passwort anmelden! 🎉", "you-can-now-use-your-new-password-to-log-in-to-your-account": "Du kannst dich jetzt mit deinem neuen Passwort anmelden! 🎉",
"zip-postal-code": "Postleitzahl" "zip-postal-code": "Postleitzahl",
"pdf-generation-failed": "pdf generation failed"
} }