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