MCPcopy Create free account
hub / github.com/OpenRaiser/PaperFlow / loadUsers

Function loadUsers

deployments/desktop/static/desktop.js:2072–2081  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

2070 }
2071
2072 async function loadUsers() {
2073 const data = await api("/api/users");
2074 state.users = data.users && data.users.length ? data.users.map(normalizeUser) : [normalizeUser("user_demo")];
2075 const ids = state.users.map((user) => user.user_id);
2076 const current = state.users.find((user) => user.is_current) || state.users[0];
2077 if (!ids.includes(state.currentUser)) state.currentUser = current.user_id;
2078 $("userSelect").innerHTML = state.users.map((user) => `<option value="${escapeHtml(user.user_id)}">${escapeHtml(user.label)}</option>`).join("");
2079 $("userSelect").value = state.currentUser;
2080 if ($("profileUserId")) $("profileUserId").value = state.currentUser;
2081 }
2082
2083 async function loadHealth() {
2084 const data = await api("/api/health");

Callers 3

saveProfileFunction · 0.70
bindEventsFunction · 0.70
initFunction · 0.70

Calls 4

normalizeUserFunction · 0.85
apiFunction · 0.70
$Function · 0.70
escapeHtmlFunction · 0.70

Tested by

no test coverage detected