parent
5e6ada140c
commit
fa3dc870d3
@ -1,5 +1,6 @@
|
||||
const config = {
|
||||
baseurl: 'https://dev.lauf-fuer-kaya.de',
|
||||
documentserver_key: 'NqZSYTy5AFQ7MppbLW5moqpTk7u7YrNUHKYhKYuThnnya2WpCOIU694hIZT1FzYe',
|
||||
fallback_username: 'admin',
|
||||
fallback_password: '72fpTzsev4xUu78QPs2FCbwZ3',
|
||||
prefersHashRouting: true
|
||||
|
@ -1,5 +1,6 @@
|
||||
const config = {
|
||||
baseurl: 'http://localhost:4010',
|
||||
documentserver_key: 'NqZSYTy5AFQ7MppbLW5moqpTk7u7YrNUHKYhKYuThnnya2WpCOIU694hIZT1FzYe'
|
||||
// optional
|
||||
prefersHashRouting: true
|
||||
};
|
||||
|
@ -1,5 +1,5 @@
|
||||
<script>
|
||||
import { _ } from "svelte-i18n";
|
||||
import { getLocaleFromNavigator, _ } from "svelte-i18n";
|
||||
import {
|
||||
RunnerService,
|
||||
RunnerTeamService,
|
||||
@ -79,7 +79,32 @@
|
||||
{#if current_runners.some((r) => r.is_selected === true)}
|
||||
<button
|
||||
on:click={() => {
|
||||
//
|
||||
const locale = getLocaleFromNavigator();
|
||||
fetch(
|
||||
`https://dev.lauf-fuer-kaya.de/documents/contracts?locale=${locale}&download=true&key=${config.documentserver_key}`,
|
||||
{
|
||||
method: 'POST',
|
||||
headers: {
|
||||
'Content-Type': 'application/json',
|
||||
},
|
||||
body: JSON.stringify(
|
||||
current_runners.filter((r) => r.is_selected === true)
|
||||
),
|
||||
}
|
||||
)
|
||||
.then((response) => response.blob())
|
||||
.then((blob) => {
|
||||
const url = window.URL.createObjectURL(blob);
|
||||
let a = document.createElement('a');
|
||||
a.href = url;
|
||||
a.download = 'Sponsoring.pdf';
|
||||
document.body.appendChild(a);
|
||||
a.click();
|
||||
a.remove();
|
||||
})
|
||||
.catch((err) => {
|
||||
console.error(err);
|
||||
});
|
||||
}}
|
||||
type="button"
|
||||
class="w-full inline-flex justify-center rounded-md border border-transparent shadow-sm px-4 py-2 bg-gray-600 text-base font-medium text-white hover:bg-gray-700 focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-gray-500 sm:w-auto sm:text-sm">
|
||||
|
Loading…
x
Reference in New Issue
Block a user