diff options
Diffstat (limited to 'profile/public')
-rw-r--r-- | profile/public/index.html | 4 | ||||
-rw-r--r-- | profile/public/script.js | 5 |
2 files changed, 4 insertions, 5 deletions
diff --git a/profile/public/index.html b/profile/public/index.html index fd7b507..672f409 100644 --- a/profile/public/index.html +++ b/profile/public/index.html @@ -19,11 +19,9 @@ <a href="/auth/api/logout" class="pure-menu-item pure-menu-link">Logout</a> </div> <main> - <h1 id="username"></h1> + <h2 id="username"></h2> <form class="pure-form pure-form-stacked"> <fieldset> - <legend>Steckbrief</legend> - <!-- TODO: Consider autosave --> <button type="submit" class="pure-button pure-button-primary">Wohooo</button> </fieldset> 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); |