feat: implemented api

This commit is contained in:
Mat12143 2025-08-02 02:12:41 +02:00
parent aa25c6075b
commit 1383c0fbed
6 changed files with 65 additions and 31 deletions

View file

@ -1,7 +1,15 @@
<script lang="ts">
let { roomId } = $props()
let input = $state("")
async function sendSong() {
let resp = await fetch(`/api/addsong?room=${roomId}&query=${input}`, { method: "POST" })
input = ""
}
</script>
<div class="flex h-full w-full flex-row items-center gap-2 rounded border-2 border-black p-4">
<input type="text" placeholder="Song & Artist" class="h-full w-3/4 rounded" />
<button class="w-1/4 rounded">Send</button>
<input type="text" placeholder="Song & Artist" class="h-full w-3/4 rounded" bind:value={input} />
<button class="w-1/4 rounded" onclick={sendSong}>Send</button>
</div>