blob: 2c52bef0a8a77ac5b6569806ff527915402cb7db [file] [log] [blame]
Davit Tabidzef99bc4f2024-01-17 22:37:32 +04001function toggle(name, status) {
2 const data = {
3 name: name,
4 active: status,
5 };
6 fetch("/api/update/", {
7 method: "POST",
8 headers: {
9 "Content-Type": "application/json",
10 },
11 body: JSON.stringify(data),
12 })
13 .then((response) => {
14 if (response.ok) {
15 window.location.reload();
16 }
17 })
18 .catch((error) => {
19 console.error("Error:", error);
20 });
21}