Use POST to update instances

This commit is contained in:
Brahim Hadriche committed 2022-11-30 20:29:58 -05:00
1 parent 16797a5144
commit 58ce258509
4 files changed
+22 -12

No files matched your search

+8 -3
View File
@@ -210,9 +210,14 @@ ${JSON.stringify(window.appState.device, null, 2)}
.filter(a => !!a)
.map(a => a.innerText);
args = instances.map(instance => `instances=${instance}`).join("&")
fetch(`/invidious/set-instances?${args}`)
fetch('/invidious/instances',
{
headers: {
'Content-Type': 'application/json'
},
method: "POST",
body: JSON.stringify(instances)
})
.then(function (response) {
alert("Instances updated. Restart Playlet to reflect changes.")
window.location.reload();