mirror of
				https://github.com/Djeeberjr/fw-anwesenheit.git
				synced 2025-11-03 23:24:10 +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";
 | 
			
		||||
  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}
 | 
			
		||||
 | 
			
		||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user