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,16 +1,23 @@
<script>
import {onMount} from 'svelte';
import {t} from '../../translations.svelte.js';
let { caption = t('select_state'), selected = $bindable(0), onchange = (val) => console.log('changed to '+val)} = $props();
import {api} from '../../urls.svelte.js';
import {t} from '../../translations.svelte.js';
let {
caption = t('select_state'),
onchange = (val) => console.log('changed to '+val),
selected = $bindable(0)
} = $props();
let message = $state(t('loading'));
let states = $state(null);
let states = $state(null);
async function loadStates(){
const url = `${location.protocol}//${location.host.replace('5173','8080')}/api/document/states`;
var resp = await fetch(url,{credentials: 'include'});
const url = api('document/states');
const resp = await fetch(url,{credentials: 'include'});
if (resp.ok){
states = await resp.json();
states = await resp.json();
} else {
message = await resp.text();
}