blob: 2c52bef0a8a77ac5b6569806ff527915402cb7db [file] [log] [blame]
function toggle(name, status) {
const data = {
name: name,
active: status,
};
fetch("/api/update/", {
method: "POST",
headers: {
"Content-Type": "application/json",
},
body: JSON.stringify(data),
})
.then((response) => {
if (response.ok) {
window.location.reload();
}
})
.catch((error) => {
console.error("Error:", error);
});
}