refactored more error code
This commit is contained in:
@@ -3,9 +3,9 @@
|
||||
import { useTinyRouter } from 'svelte-tiny-router';
|
||||
|
||||
import { api } from '../../urls.svelte.js';
|
||||
import { error, yikes } from '../../warn.svelte';
|
||||
import { t } from '../../translations.svelte.js';
|
||||
|
||||
let error = $state(null);
|
||||
let projects = $state({});
|
||||
let router = useTinyRouter();
|
||||
let tasks = $state(null);
|
||||
@@ -27,7 +27,7 @@
|
||||
if (resp.ok){
|
||||
tasks[tid] = await resp.json();
|
||||
} else {
|
||||
error = await resp.text();
|
||||
error(resp);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -53,7 +53,7 @@
|
||||
if (resp.ok){
|
||||
projects[pid] = await resp.json();
|
||||
} else {
|
||||
error = await resp.text();
|
||||
error(resp);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -77,7 +77,7 @@
|
||||
load();
|
||||
}
|
||||
} else {
|
||||
error = await resp.text();
|
||||
error(resp);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -102,9 +102,6 @@
|
||||
|
||||
<fieldset>
|
||||
<legend>{loading ? t('loading_object',{object:t('task_list')}) : t('task_list')}</legend>
|
||||
{#if error}
|
||||
<soan class="error">{error}</soan>
|
||||
{/if}
|
||||
{#if tasks}
|
||||
<table>
|
||||
<thead>
|
||||
|
||||
Reference in New Issue
Block a user