Skip to content

Commit

Permalink
fix(web): the api doesn't accept JSON
Browse files Browse the repository at this point in the history
:)
  • Loading branch information
TheTipo01 committed Oct 24, 2023
1 parent d6ef59a commit 6646c4d
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 3 deletions.
1 change: 1 addition & 0 deletions web/.gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -8,3 +8,4 @@ node_modules
!.env.example
vite.config.js.timestamp-*
vite.config.ts.timestamp-*
.idea
11 changes: 9 additions & 2 deletions web/src/lib/queue.js
Original file line number Diff line number Diff line change
Expand Up @@ -19,9 +19,16 @@ export async function AddToQueue() {
method: 'POST',
headers: {
'Accept': 'application/json',
'Content-Type': 'application/json'
'Content-Type': 'application/x-www-form-urlencoded'
},
body: JSON.stringify({"song": song, "playlist": playlist, "shuffle": shuffle, "loop": loop, "priority": priority, "token": token})
body: new URLSearchParams({
'token': token,
'song': song,
'shuffle': shuffle,
'playlist': playlist,
'loop': loop,
'priority': priority
}).toString(),
})

//Error Handling
Expand Down
2 changes: 1 addition & 1 deletion web/src/routes/queue.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
<Label for="id" class="block mb-2">Guild ID</Label>
<Input type="text" id="id" />
<Label for="link" class="mt-2">Song name or link</Label>
<Input type="text" id="link" />
<Input type="text" id="song" />
<Label for="token" class="mt-2">User token</Label>
<Input type="text" id="token" />
<Label for="playlist" class="mt-2"> Playlist </Label>
Expand Down

0 comments on commit 6646c4d

Please sign in to comment.