diff options
Diffstat (limited to 'profile/public/script.js')
-rw-r--r-- | profile/public/script.js | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/profile/public/script.js b/profile/public/script.js index 3b39460..b927f9f 100644 --- a/profile/public/script.js +++ b/profile/public/script.js @@ -3,7 +3,7 @@ const form = document.querySelector("form"); let init = true; function updateHeading(user) { - document.getElementById("username").textContent = `${user.name} ${user.surname}`; + document.getElementById("username").textContent = `Steckbrief: ${user.name} ${user.middlename || ""} ${user.surname}`; } function appendQuestions(question) { @@ -51,7 +51,8 @@ form.addEventListener("submit", async (evt) => { if (res !== "ok") alert("AHHHH"); else location.reload(); }); -fetch("api/user") + +fetch("/auth/api/self") .then((response) => response.json()) .then(updateHeading) .catch(console.error); |