From 4e18a6aeb978b29e6bac9464e44c1911dce50801 Mon Sep 17 00:00:00 2001 From: SinTan1729 Date: Tue, 8 Nov 2022 19:29:01 -0600 Subject: [PATCH] Add error box in async --- src/main/resources/public/js/main.js | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/src/main/resources/public/js/main.js b/src/main/resources/public/js/main.js index 93c0411..136dd15 100644 --- a/src/main/resources/public/js/main.js +++ b/src/main/resources/public/js/main.js @@ -20,7 +20,7 @@ const displayData = (data) => { .forEach(tr => table.appendChild(tr)); }; -const addErrBox = () => { +const addErrBox = async () => { const controls = document.querySelector(".pure-controls"); const errBox = document.createElement("p"); errBox.setAttribute("id", "errBox"); @@ -82,7 +82,6 @@ const submitForm = () => { body: `${longUrl.value};${shortUrl.value}` }) .then((res) => { - console.log("0"); if (!res.ok) { if (document.getElementById("errBox") == null) { addErrBox();