diff options
Diffstat (limited to 'dist')
-rw-r--r-- | dist/callback.html | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/dist/callback.html b/dist/callback.html index 7bda9f3..eaf689b 100644 --- a/dist/callback.html +++ b/dist/callback.html @@ -27,7 +27,7 @@ fetch("https://kobert.dev/spotify-api/callback/" + token + "/" + getParameterByName("code")) .then(function(response) { if (!response.ok) { - document.getElementById("status").innerHTML = "Error occured while loading songs: ${response.status}"; + document.getElementById("status").innerHTML = `Error occured while loading songs: ${response.status}`; throw new Error(`HTTP error! status: ${response.status}`); } document.getElementById("status").innerHTML = "Loaded songs"; @@ -41,10 +41,12 @@ function match_users() { fetch("https://kobert.dev/spotify-api/match/" + name1 + "/" + name2) .then(function(response) { if (!response.ok) { - document.getElementById("status").innerHTML = "Error occured while loading songs: ${response.status}"; + document.getElementById("status").innerHTML = `Error occured while loading songs: ${response.status}`; throw new Error(`HTTP error! status: ${response.status}`); } - document.getElementById("output").innerHTML = response.body; + response.text().then(function(message) { + document.getElementById("output").innerHTML = message; + }); }); } </script> |