cleaning up javascript code
This commit is contained in:
@@ -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 {
|
||||
|
||||
Reference in New Issue
Block a user