diff options
| author | Kit La Touche <kit@transneptune.net> | 2024-10-30 16:50:06 -0400 |
|---|---|---|
| committer | Kit La Touche <kit@transneptune.net> | 2024-10-30 16:50:06 -0400 |
| commit | 113096a2cca42008c0a19110abe322180dbdf66b (patch) | |
| tree | cb871dae060e60be7fd2114ee4741027ae38bd78 /ui/lib/components/Invites.svelte | |
| parent | 610f6839d2e449d172aa6ac35e6c1de0677a0754 (diff) | |
| parent | 06c839436900ce07ec5c53175b01f3c5011e507c (diff) | |
Merge branch 'main' into wip/mobile
Diffstat (limited to 'ui/lib/components/Invites.svelte')
| -rw-r--r-- | ui/lib/components/Invites.svelte | 28 |
1 files changed, 28 insertions, 0 deletions
diff --git a/ui/lib/components/Invites.svelte b/ui/lib/components/Invites.svelte new file mode 100644 index 0000000..df51afb --- /dev/null +++ b/ui/lib/components/Invites.svelte @@ -0,0 +1,28 @@ +<script> + import { writable } from 'svelte/store'; + import { createInvite } from '$lib/apiServer'; + import Invite from '$lib/components/Invite.svelte'; + + let invites = writable([]); + $: $invites, console.log("invites", $invites); + + async function onSubmit() { + let response = await createInvite(); + if (response.status == 200) { + invites.update(val => [...val, response.data]); + } + } +</script> + +<ul> + {#each $invites as invite} + <li><Invite id={invite.id} /></li> + {/each} +</ul> +<form on:submit|preventDefault={onSubmit}> + <button + class="btn variant-filled" + type="submit"> + Create Invitation + </button> +</form> |
