cleaning up javascript code

This commit is contained in:
2025-07-29 09:01:37 +02:00
parent 89abbf5c62
commit 90a936b07f
13 changed files with 138 additions and 114 deletions

View File

@@ -1,20 +1,21 @@
<script>
import {onMount} from 'svelte';
import {t} from '../translations.svelte.js';
import {api} from '../urls.svelte.js';
import {api} from '../urls.svelte.js';
import {t} from '../translations.svelte.js';
let {
caption = t('select_state'),
selected = $bindable(0),
onchange = (val) => console.log('changed to '+val),
caption = t('select_state'),
selected = $bindable(0),
onchange = (val) => console.log('changed to '+val),
project_id = '?'
} = $props();
let message = $state(t('loading'));
let states = $state(null);
let states = $state(null);
async function loadStates(){
const url = api(`project/${project_id}/states`);
var resp = await fetch(url,{credentials: 'include'});
const url = api(`project/${project_id}/states`);
const resp = await fetch(url,{credentials: 'include'});
if (resp.ok){
states = await resp.json();
} else {