mirror of
https://github.com/Djeeberjr/fw-anwesenheit.git
synced 2025-07-02 01:04:16 +00:00
made data in IDTable reloadable
This commit is contained in:
parent
ea9ad2b995
commit
f84b09bfd1
@ -3,6 +3,12 @@
|
|||||||
import type { IDMapping } from "./IDMapping";
|
import type { IDMapping } from "./IDMapping";
|
||||||
let data: IDMapping | undefined = $state();
|
let data: IDMapping | undefined = $state();
|
||||||
|
|
||||||
|
export async function reloadData() {
|
||||||
|
let res = await fetch("/api/mapping");
|
||||||
|
|
||||||
|
data = await res.json();
|
||||||
|
}
|
||||||
|
|
||||||
let rows = $derived(
|
let rows = $derived(
|
||||||
data
|
data
|
||||||
? Object.entries(data.id_map).map(([id, value]) => ({
|
? Object.entries(data.id_map).map(([id, value]) => ({
|
||||||
@ -37,10 +43,9 @@
|
|||||||
}
|
}
|
||||||
|
|
||||||
onMount(async () => {
|
onMount(async () => {
|
||||||
let res = await fetch("/api/mapping");
|
await reloadData();
|
||||||
|
|
||||||
data = await res.json();
|
|
||||||
});
|
});
|
||||||
|
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
{#if data == null}
|
{#if data == null}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user