inital preauthkey implementation

This commit is contained in:
Chris Bisset 2025-07-12 23:23:13 +00:00
parent c11ee3a280
commit ff61385f24

View file

@ -1,5 +1,6 @@
<script lang="ts">
import { preauthkey, user } from '$lib/components/common/classes.svelte';
import Svelecte from 'svelecte';
import { user } from '$lib/components/common/classes.svelte';
import { getPreauthKeys } from './preauthkeys-functions.svelte';
interface Props {
@ -7,13 +8,12 @@
}
let { userCard }: Props = $props();
let preauthKeys: preauthkey[] = $state([]);
let preauthKeys: string[] = $state([]);
getPreauthKeys(userCard.id).then((returnedPreAuthKeys) => {
preauthKeys = returnedPreAuthKeys;
preauthKeys = returnedPreAuthKeys.map(obj => obj.key);
});
let selectedKey = $state('');
</script>
{#each preauthKeys as preauthkey}
<p>{preauthkey.key}</p>
{/each}
<Svelecte options={preauthKeys} bind:value={selectedKey} />