mirror of
https://github.com/SinTan1729/chhoto-url
synced 2024-12-26 23:58:35 -06:00
Confirm before deleting entries
This commit is contained in:
parent
77f835430b
commit
b73148706d
1 changed files with 5 additions and 3 deletions
|
@ -54,9 +54,11 @@ const deleteButton = (shortUrl) => {
|
||||||
|
|
||||||
btn.onclick = e => {
|
btn.onclick = e => {
|
||||||
e.preventDefault();
|
e.preventDefault();
|
||||||
fetch(`/api/${shortUrl}`, {
|
if (confirm("Do you want to delete the entry " + shortUrl + "?")) {
|
||||||
method: "DELETE"
|
fetch(`/api/${shortUrl}`, {
|
||||||
}).then(_ => refreshData());
|
method: "DELETE"
|
||||||
|
}).then(_ => refreshData());
|
||||||
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
return btn;
|
return btn;
|
||||||
|
|
Loading…
Reference in a new issue