fix(webui): specify DELETE method for source/template removal

delSource and delTemplate called api() without a method, so fetch
defaulted to GET; the DELETE handlers never ran and the UI silently
left the item in place.
This commit is contained in:
JianFeeeee
2026-08-27 12:14:41 +08:00
parent 8334cffbc9
commit ab20f1be48

View File

@ -2720,7 +2720,9 @@
async function delTemplate(name) {
if (!confirm(tFmt("tplConfirmDel", name))) return;
try {
await api("/api/source_templates/" + encodeURIComponent(name), {});
await api("/api/source_templates/" + encodeURIComponent(name), {
method: "DELETE",
});
toast(t("toastDelOk"));
openTemplateModal();
} catch (e) {
@ -2817,6 +2819,7 @@
async function delSource(name) {
if (!confirm(tFmt("confirmDelSrc", name))) return;
await api("/api/sources/" + encodeURIComponent(name), {
method: "DELETE",
});
toast(t("toastDelOk"));
renderSources();