enforce purgatory
This commit is contained in:
@@ -1,7 +1,6 @@
|
||||
const body = document.getElementById("enrollment-body");
|
||||
const loadingRow = document.getElementById("enrollment-loading");
|
||||
const emptyEl = document.getElementById("enrollment-empty");
|
||||
const toggleEl = document.getElementById("require-approval-toggle");
|
||||
const selectAllEl = document.getElementById("select-all");
|
||||
const bulkApproveBtn = document.getElementById("bulk-approve-btn");
|
||||
const bulkDenyBtn = document.getElementById("bulk-deny-btn");
|
||||
@@ -64,13 +63,6 @@ async function loadStats() {
|
||||
} catch {}
|
||||
}
|
||||
|
||||
async function loadSettings() {
|
||||
try {
|
||||
const s = await api("/api/enrollment/settings");
|
||||
toggleEl.checked = s.requireApproval;
|
||||
} catch {}
|
||||
}
|
||||
|
||||
async function loadClients() {
|
||||
loadingRow.classList.remove("hidden");
|
||||
emptyEl.classList.add("hidden");
|
||||
@@ -242,25 +234,6 @@ document.querySelectorAll(".enrollment-tab").forEach((tab) => {
|
||||
});
|
||||
});
|
||||
|
||||
// ── Toggle require approval ────────────────────────────────────────
|
||||
toggleEl.addEventListener("change", async () => {
|
||||
try {
|
||||
await api("/api/enrollment/settings", {
|
||||
method: "PUT",
|
||||
headers: { "Content-Type": "application/json" },
|
||||
body: JSON.stringify({ requireApproval: toggleEl.checked }),
|
||||
});
|
||||
if (window.showToast)
|
||||
window.showToast(
|
||||
toggleEl.checked ? "Approval required" : "Auto-approve enabled",
|
||||
"success",
|
||||
);
|
||||
} catch (e) {
|
||||
toggleEl.checked = !toggleEl.checked;
|
||||
if (window.showToast) window.showToast(`Failed: ${e.message}`, "error");
|
||||
}
|
||||
});
|
||||
|
||||
// ── Table delegation ───────────────────────────────────────────────
|
||||
body.addEventListener("click", (e) => {
|
||||
const btn = e.target.closest("button");
|
||||
@@ -434,7 +407,6 @@ confirmBanBtn.addEventListener("click", async () => {
|
||||
});
|
||||
|
||||
// ── Init ───────────────────────────────────────────────────────────
|
||||
loadSettings();
|
||||
loadStats();
|
||||
loadClients();
|
||||
|
||||
|
||||
Reference in New Issue
Block a user