Fix deleting template making a call on empty template list
This commit is contained in:
parent
99eea16f62
commit
b8707bbc9a
@ -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;
|
||||
|
Loading…
Reference in New Issue
Block a user