made data in IDTable reloadable

This commit is contained in:
Djeeberjr 2025-05-20 13:20:21 +02:00
parent ea9ad2b995
commit f84b09bfd1

View File

@ -3,6 +3,12 @@
import type { IDMapping } from "./IDMapping";
let data: IDMapping | undefined = $state();
export async function reloadData() {
let res = await fetch("/api/mapping");
data = await res.json();
}
let rows = $derived(
data
? Object.entries(data.id_map).map(([id, value]) => ({
@ -37,10 +43,9 @@
}
onMount(async () => {
let res = await fetch("/api/mapping");
data = await res.json();
await reloadData();
});
</script>
{#if data == null}