MCPcopy Create free account
hub / github.com/error311/FileRise / loadUserList

Function loadUserList

public/js/auth.js:832–853  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

830}
831
832function loadUserList() {
833 // Updated path: from "/api/getUsers.php" to "/api/admin/getUsers.php"
834 fetch("/api/admin/getUsers.php", { credentials: "include" })
835 .then(response => response.json())
836 .then(data => {
837 // Assuming the endpoint returns an array of users.
838 const users = Array.isArray(data) ? data : (data.users || []);
839 const selectElem = document.getElementById("removeUsernameSelect");
840 selectElem.innerHTML = "";
841 users.forEach(user => {
842 const option = document.createElement("option");
843 option.value = user.username;
844 option.textContent = user.username;
845 selectElem.appendChild(option);
846 });
847 if (selectElem.options.length === 0) {
848 showToast(t('remove_user_none'));
849 closeRemoveUserModal();
850 }
851 })
852 .catch(() => { /* handle errors if needed */ });
853}
854window.loadUserList = loadUserList;
855
856function initAuth() {

Callers 1

initAuthFunction · 0.85

Calls 3

tFunction · 0.85
closeRemoveUserModalFunction · 0.85
showToastFunction · 0.70

Tested by

no test coverage detected