@@ -50,7 +50,13 @@
|
||||
on:click={async () => {
|
||||
const locale = getLocaleFromNavigator();
|
||||
const teams = current_teams.filter((r) => r.is_selected === true);
|
||||
const toast = Toastify({
|
||||
text: $_('generating-pdfs'),
|
||||
duration: -1,
|
||||
}).showToast();
|
||||
let count = 0;
|
||||
for await (const t of teams) {
|
||||
count++;
|
||||
const runners = await RunnerTeamService.runnerTeamControllerGetRunners(t.id);
|
||||
fetch(
|
||||
`https://dev.lauf-fuer-kaya.de/documents/contracts?locale=${locale}&download=true&key=${config.documentserver_key}`,
|
||||
@@ -71,6 +77,15 @@
|
||||
document.body.appendChild(a);
|
||||
a.click();
|
||||
a.remove();
|
||||
if (count === teams.length) {
|
||||
toast.hideToast();
|
||||
Toastify({
|
||||
text: $_('pdfs-successfully-generated'),
|
||||
duration: 3500,
|
||||
backgroundColor:
|
||||
'linear-gradient(to right, #00b09b, #96c93d)',
|
||||
}).showToast();
|
||||
}
|
||||
})
|
||||
.catch((err) => {});
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user