code cleanup

This commit is contained in:
2025-07-30 09:03:47 +02:00
parent a77efb4e41
commit 631a527a5d
18 changed files with 257 additions and 184 deletions

View File

@@ -1,21 +1,30 @@
<script>
import {onMount} from 'svelte';
import {t} from '../../translations.svelte.js';
let { caption, company, value = $bindable(0), onchange = () => console.log('changed')} = $props();
let message = t('loading');
import {api} from '../../urls.svelte.js';
import {t} from '../../translations.svelte.js';
let {
caption,
company,
value = $bindable(0),
onchange = () => console.log('changed')
} = $props();
let message = t('loading');
let templates = $state(null);
async function loadTemplates(){
const url = `${location.protocol}//${location.host.replace('5173','8080')}/api/document/templates`;
const url = api('document/templates');
var resp = await fetch(url,{
credentials: 'include',
method: 'POST',
body: JSON.stringify({company:company})
credentials : 'include',
method : 'POST',
body : JSON.stringify({company:company})
});
if (resp.ok){
templates = await resp.json();
} else {
message = await resp.text();
message = await resp.text();
}
}