diff --git a/src/main/resources/public/js/main.js b/src/main/resources/public/js/main.js index 136dd15..cfa469d 100644 --- a/src/main/resources/public/js/main.js +++ b/src/main/resources/public/js/main.js @@ -54,9 +54,11 @@ const deleteButton = (shortUrl) => { btn.onclick = e => { e.preventDefault(); - fetch(`/api/${shortUrl}`, { - method: "DELETE" - }).then(_ => refreshData()); + if (confirm("Do you want to delete the entry " + shortUrl + "?")) { + fetch(`/api/${shortUrl}`, { + method: "DELETE" + }).then(_ => refreshData()); + } }; return btn;