mirror of
https://gitcode.com/JianFeeeee/ModelRouter.git
synced 2026-09-19 16:39:15 +00:00
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:
@ -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) {
|
||||
@ -2816,8 +2818,9 @@
|
||||
}
|
||||
async function delSource(name) {
|
||||
if (!confirm(tFmt("confirmDelSrc", name))) return;
|
||||
await api("/api/sources/" + encodeURIComponent(name), {
|
||||
});
|
||||
await api("/api/sources/" + encodeURIComponent(name), {
|
||||
method: "DELETE",
|
||||
});
|
||||
toast(t("toastDelOk"));
|
||||
renderSources();
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user