Skip to content

Commit 6eb4d96

Browse files
authored
Adding confirm box to the deletion in the Wiki.html
1 parent 54b0ced commit 6eb4d96

File tree

1 file changed

+8
-2
lines changed

1 file changed

+8
-2
lines changed

Wiki/Wiki.html

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -63,8 +63,14 @@
6363
}
6464

6565
async function deletePage(id) {
66-
await fetch(`${apiUrl}/${id}`, { method: 'DELETE' });
67-
fetchPages();
66+
if (confirm("Are you sure that you want to delete this page? Abusing the delete function can result in a ban from Coding Hut.") == true) {
67+
await fetch(`${apiUrl}/${id}`, { method: 'DELETE' });
68+
fetchPages();
69+
alert("The page has been deleted.");
70+
} else {
71+
alert("Cancelled!");
72+
}
73+
6874
}
6975

7076
function renderPages(pages) {

0 commit comments

Comments
 (0)