Fix deleting template making a call on empty template list

This commit is contained in:
jude 2023-07-30 17:16:37 +01:00
parent 99eea16f62
commit b8707bbc9a

View File

@ -872,6 +872,7 @@ $loadTemplateBtn.addEventListener("click", (ev) => {
});
$deleteTemplateBtn.addEventListener("click", (ev) => {
if (parseInt($templateSelect.value) !== null) {
fetch(`/dashboard/api/guild/${guildId()}/templates`, {
method: "DELETE",
headers: {
@ -889,6 +890,7 @@ $deleteTemplateBtn.addEventListener("click", (ev) => {
.remove();
}
});
}
});
let $img;