From ce7c01ed413c5aaec36bbab0da601118855d1c16 Mon Sep 17 00:00:00 2001 From: Marvin Borner Date: Fri, 29 Jan 2021 14:53:08 +0100 Subject: Okidoki --- prediction/public/script.js | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) (limited to 'prediction/public/script.js') diff --git a/prediction/public/script.js b/prediction/public/script.js index 364789f..029c4f8 100644 --- a/prediction/public/script.js +++ b/prediction/public/script.js @@ -11,7 +11,9 @@ function appendOption(response) { response.forEach((elem, i) => { dropdown.insertAdjacentHTML( "beforeend", - ``, + ``, ); }); } @@ -35,5 +37,10 @@ submit.addEventListener("click", async (e) => { const body = JSON.stringify({ teacher }); const resp = await fetch("api/set", { method, body, headers: { "Content-Type": "application/json" } }); const res = await resp.json(); - if (res.success) method = "PUT"; -}); \ No newline at end of file + if (res.success) { + method = "PUT"; + alert("Okidoki!"); + } else { + alert("Sorry, Fehler!"); + } +}); -- cgit v1.2.3