code cleanup
This commit is contained in:
@@ -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();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user