fix admin edit
All checks were successful
deploy / build-and-deploy (push) Successful in 22s

This commit is contained in:
2025-05-18 17:53:06 +02:00
parent 078ae89708
commit 7ac248baf5
6 changed files with 21 additions and 9 deletions

View File

@ -32,7 +32,7 @@
</tr>
</thead>
<tbody>
{#each $admins as admin, i (admin.id)}
{#each $admins as admin, i (admin)}
<tr class="hover:bg-base-200">
<td>{i + 1}</td>
<td>{admin.username}</td>

View File

@ -23,6 +23,7 @@
const index = reactiveSet.indexOf(badge);
if (index !== -1) {
reactiveSet.splice(index, 1);
onUpdate?.(reactiveSet);
}
}
</script>

View File

@ -44,7 +44,7 @@
let password = $state<string | null>(null);
let permissions = $state<number | null>(admin?.permissions ?? 0);
let submitEnabled = $derived(!!(username && password));
let submitEnabled = $derived(!!username && (admin || password));
// lifecycle
$effect(() => {
@ -85,7 +85,7 @@
<div class="w-full gap-x-4 gap-y-2">
<div class="w-[20rem]">
<Input type="text" bind:value={username} label="Username" required />
<Password bind:value={password} label="Password" required />
<Password bind:value={password} label="Password" required={!admin} />
</div>
<fieldset class="fieldset">
<legend class="fieldset-legend">Berechtigungen</legend>