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) => {
|
$deleteTemplateBtn.addEventListener("click", (ev) => {
|
||||||
|
if (parseInt($templateSelect.value) !== null) {
|
||||||
fetch(`/dashboard/api/guild/${guildId()}/templates`, {
|
fetch(`/dashboard/api/guild/${guildId()}/templates`, {
|
||||||
method: "DELETE",
|
method: "DELETE",
|
||||||
headers: {
|
headers: {
|
||||||
@ -889,6 +890,7 @@ $deleteTemplateBtn.addEventListener("click", (ev) => {
|
|||||||
.remove();
|
.remove();
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
let $img;
|
let $img;
|
||||||
|
Loading…
Reference in New Issue
Block a user