blob: 73f0e4a7b273a2564444db4c93da2835ccef9bf9 (
plain) (
blame)
1
2
3
4
5
6
7
8
9
10
|
function addUser(user) {
const li = document.createElement("li");
li.textContent = `${user.name} ${user.middlename || ""} ${user.surname}`;
li.addEventListener("click", () => window.location.assign(`./user.html?uid=${user.id}`));
if (user.class_id < 6) document.getElementById("class_" + user.class_id).appendChild(li);
}
fetch("/auth/api/list?class=all")
.then((response) => response.json())
.then((response) => response.forEach(addUser));
|