feat: migrate admins to better auth roles
This commit is contained in:
@@ -5,6 +5,7 @@
|
||||
import { Button } from '$lib/components/ui/button/index.js';
|
||||
import * as Dialog from '$lib/components/ui/dialog/index.js';
|
||||
import { Input } from '$lib/components/ui/input/index.js';
|
||||
import * as NativeSelect from '$lib/components/ui/native-select/index.js';
|
||||
let {
|
||||
editingUser,
|
||||
editForm,
|
||||
@@ -23,7 +24,7 @@
|
||||
<Dialog.Root open={!!editingUser} onOpenChange={(open) => !open && onClose()}>
|
||||
<Dialog.Content class="sm:max-w-md">
|
||||
<Dialog.Header>
|
||||
<Dialog.Title>Edit admin</Dialog.Title>
|
||||
<Dialog.Title>Edit user</Dialog.Title>
|
||||
<Dialog.Description>Update account details or set a new password.</Dialog.Description>
|
||||
</Dialog.Header>
|
||||
{#if editingUser}
|
||||
@@ -68,6 +69,20 @@
|
||||
<Field.Error><FieldErrors /></Field.Error>
|
||||
</Field.Field>
|
||||
</FormField>
|
||||
<FormField form={editForm} name="role">
|
||||
<Field.Field>
|
||||
<Control id="edit-role">
|
||||
{#snippet children({ props })}
|
||||
<Field.Label>Role</Field.Label>
|
||||
<NativeSelect.Root {...props} bind:value={$editData.role} class="w-full">
|
||||
<NativeSelect.Option value="admin">Admin</NativeSelect.Option>
|
||||
<NativeSelect.Option value="user">User</NativeSelect.Option>
|
||||
</NativeSelect.Root>
|
||||
{/snippet}
|
||||
</Control>
|
||||
<Field.Error><FieldErrors /></Field.Error>
|
||||
</Field.Field>
|
||||
</FormField>
|
||||
<Dialog.Footer>
|
||||
<Dialog.Close>
|
||||
{#snippet child({ props })}
|
||||
|
||||
Reference in New Issue
Block a user