refactored more error code

This commit is contained in:
2025-09-26 21:10:19 +02:00
parent e3b735bb7b
commit 2463f92b1c
23 changed files with 111 additions and 173 deletions

View File

@@ -2,6 +2,7 @@
import { onMount } from 'svelte';
import { api, target } from '../../urls.svelte.js';
import { error, yikes } from '../../warn.svelte';
import { t } from '../../translations.svelte.js';
let {
@@ -9,7 +10,6 @@
onSelect = (time) => {}
} = $props();
let error = $state(null);
let projects = $state(null);
let times = $state(null);
@@ -23,8 +23,9 @@
});
if (resp.ok){
projects = await resp.json();
yikes();
} else {
error = await resp.body();
error(resp);
}
}
@@ -39,7 +40,7 @@
if (resp.ok){
times = await resp.json();
} else {
error = await resp.body();
error(resp);
}
}