WebUI: migrate to fetch API

This is the final part of it.

PR #22072.
This commit is contained in:
Chocobo1
2024-12-29 15:44:28 +08:00
committed by GitHub
parent e740a42366
commit 9c0475ebfa
15 changed files with 626 additions and 551 deletions

View File

@@ -67,16 +67,18 @@
const newPluginOk = () => {
const path = $("newPluginPath").value.trim();
if (path) {
new Request({
url: "api/v2/search/installPlugin",
method: "post",
data: {
sources: path,
},
onRequest: () => {
fetch("api/v2/search/installPlugin", {
method: "POST",
body: new URLSearchParams({
sources: path
})
})
.then((response) => {
if (!response.ok)
return;
window.qBittorrent.Client.closeWindow(document.getElementById("installSearchPlugin"));
}
}).send();
});
}
};