Ability to delete links from database

This commit is contained in:
SinTan1729
2023-04-03 17:58:19 -05:00
parent 98d10cfd5b
commit e4ff2df3f1
3 changed files with 16 additions and 2 deletions

View File

@@ -108,7 +108,7 @@ const deleteButton = (shortUrl) => {
e.preventDefault();
if (confirm("Do you want to delete the entry " + shortUrl + "?")) {
document.getElementById("alertBox")?.remove();
fetch(`/api/${shortUrl}`, {
fetch(`/api/del/${shortUrl}`, {
method: "DELETE"
}).then(_ => refreshData());
}