implemented loading of accounts

Signed-off-by: Stephan Richter <s.richter@srsoftware.de>
This commit is contained in:
2026-04-02 13:39:35 +02:00
parent c0ab71d71d
commit 44fb120891
5 changed files with 82 additions and 5 deletions

View File

@@ -1,14 +1,28 @@
<script>
import { onMount } from 'svelte';
import { useTinyRouter } from 'svelte-tiny-router';
import { t } from '../../translations.svelte';
import { api, get } from '../../urls.svelte';
import { error, yikes } from '../../warn.svelte';
const router = useTinyRouter();
let accounts = [];
async function load(){
let url = api('accounting');
let res = await get(url);
if (res.ok){
yikes();
accounts = await res.json();
} else error(res);
}
function newAccount(){
router.navigate('/accounting/new');
}
onMount(load);
</script>
<fieldset>