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

@@ -749,7 +749,11 @@ window.addEventListener("DOMContentLoaded", () => {
let syncRequestInProgress = false;
const syncMainData = () => {
syncRequestInProgress = true;
fetch(new URI("api/v2/sync/maindata").setData("rid", syncMainDataLastResponseId), {
const url = new URL("api/v2/sync/maindata", window.location);
url.search = new URLSearchParams({
rid: syncMainDataLastResponseId
});
fetch(url, {
method: "GET",
cache: "no-store"
})