preparing item service for use in document service

This commit is contained in:
2025-07-13 10:47:08 +02:00
parent 1a7002b0da
commit ea888c2be4
11 changed files with 117 additions and 3 deletions

View File

@@ -1,7 +1,26 @@
<script>
import { t } from '../../translations.svelte.js';
import { onMount } from 'svelte';
let items = $state(null);
let error = $state(null);
async function loadItems(){
const url = `${location.protocol}//${location.host.replace('5173','8080')}/api/items/list`;
const resp = await fetch(url,{credentials:'include'});
if (resp.ok){
items = await resp.json();
} else {
error = await resp.body();
}
}
onMount(loadItems);
</script>
<div>
<h1>Items</h1>
{#if error}
<span class="error">{error}</span>
{/if}
</div>