mirror of
				https://github.com/Djeeberjr/fw-anwesenheit.git
				synced 2025-11-03 23:24:10 +00:00 
			
		
		
		
	edit ids that are already mapped
This commit is contained in:
		
							parent
							
								
									09725c1e04
								
							
						
					
					
						commit
						732411cd50
					
				@ -42,7 +42,9 @@
 | 
			
		||||
    />
 | 
			
		||||
  </div>
 | 
			
		||||
  <div>
 | 
			
		||||
    <IDTable bind:this={idTable} />
 | 
			
		||||
    <IDTable bind:this={idTable} onEdit={(id,firstName,lastName)=>{
 | 
			
		||||
      addModal.open(id,firstName,lastName);
 | 
			
		||||
    }}/>
 | 
			
		||||
  </div>
 | 
			
		||||
 | 
			
		||||
  <AddIDModal
 | 
			
		||||
 | 
			
		||||
@ -9,8 +9,12 @@
 | 
			
		||||
 | 
			
		||||
  let modal: Modal;
 | 
			
		||||
 | 
			
		||||
  export function open(id: string) {
 | 
			
		||||
    displayID = id;
 | 
			
		||||
  export function open(presetID: string, presetFirstName?: string, presetLastName?: string) {
 | 
			
		||||
    displayID = presetID;
 | 
			
		||||
 | 
			
		||||
    firstName = presetFirstName ?? "";
 | 
			
		||||
    lastName = presetLastName ?? "";
 | 
			
		||||
 | 
			
		||||
    modal.open();
 | 
			
		||||
  }
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
@ -3,6 +3,8 @@
 | 
			
		||||
  import type { IDMapping } from "./IDMapping";
 | 
			
		||||
  let data: IDMapping | undefined = $state();
 | 
			
		||||
 | 
			
		||||
  let { onEdit }: { onEdit?: (string,string,string) => void } = $props();
 | 
			
		||||
 | 
			
		||||
  export async function reloadData() {
 | 
			
		||||
    let res = await fetch("/api/mapping");
 | 
			
		||||
 | 
			
		||||
@ -82,6 +84,8 @@
 | 
			
		||||
 | 
			
		||||
            <span class="indicator">{indicator("first")}</span>
 | 
			
		||||
          </th>
 | 
			
		||||
          <th>
 | 
			
		||||
          </th>
 | 
			
		||||
        </tr>
 | 
			
		||||
      </thead>
 | 
			
		||||
      <tbody>
 | 
			
		||||
@ -90,6 +94,9 @@
 | 
			
		||||
            <td class="whitespace-nowrap pr-5 pl-2 py-1">{row.id}</td>
 | 
			
		||||
            <td class="whitespace-nowrap pr-5">{row.last}</td>
 | 
			
		||||
            <td class="whitespace-nowrap pr-5">{row.first}</td>
 | 
			
		||||
            <td class="pr-5" ><button onclick={()=>{
 | 
			
		||||
              onEdit && onEdit(row.id,row.first,row.last);
 | 
			
		||||
            }} class="cursor-pointer">🔧</button></td>
 | 
			
		||||
          </tr>
 | 
			
		||||
        {/each}
 | 
			
		||||
      </tbody>
 | 
			
		||||
 | 
			
		||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user