mirror of
https://github.com/minoplhy/chhoto-url.git
synced 2024-11-22 17:26:45 +00:00
Confirm before deleting entries
This commit is contained in:
parent
77f835430b
commit
b73148706d
@ -54,9 +54,11 @@ const deleteButton = (shortUrl) => {
|
|||||||
|
|
||||||
btn.onclick = e => {
|
btn.onclick = e => {
|
||||||
e.preventDefault();
|
e.preventDefault();
|
||||||
|
if (confirm("Do you want to delete the entry " + shortUrl + "?")) {
|
||||||
fetch(`/api/${shortUrl}`, {
|
fetch(`/api/${shortUrl}`, {
|
||||||
method: "DELETE"
|
method: "DELETE"
|
||||||
}).then(_ => refreshData());
|
}).then(_ => refreshData());
|
||||||
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
return btn;
|
return btn;
|
||||||
|
Loading…
Reference in New Issue
Block a user