Implement edit-player. Optimizations.

This commit is contained in:
MaxJa4
2024-01-16 20:54:49 +01:00
parent fc084108ac
commit 94e0c178f0
14 changed files with 100 additions and 35 deletions

View File

@@ -38,10 +38,7 @@
const oppClanListIndex = document.getElementById('opponent-clan').selectedIndex;
const submitButton = deletePlayerModal.querySelector('button[name="submit"]');
submitButton.addEventListener('click', function (e) {
e.preventDefault();
submitButton.onclick = function () {}
submitButton.addEventListener('click', function () {
fetch("/player/" + playerId, {
method: "DELETE",
headers: {
@@ -60,7 +57,7 @@
.catch((error) => {
throw new Error(error)
});
})
}, { once: true });
});
}
});