src/static/js/admin-stats.js
// Populate users on the stats page
Populate users on the stats page
Populate users on the stats page
async function populateUsers() {
  const usersURL = "/api/getUsers";
  let users = null;
  try {
    users = await fetchJSON(usersURL);
  } catch (err) {
    showError("Failed to update users");
  }
  if (users) {
    hideError();
    hideElement("users-status");
    clearElement("site-users");
    for (const user of users) {
      const newItem = createUserRow(user);
      appendTo("site-users", newItem);
    }
  }
}
async function populateUsers ( ) { const usersURL = "/api/getUsers" ; let users = null ; try { users = await fetchJSON ( usersURL ) ; } catch ( err ) { showError ( "Failed to update users" ) ; } if ( users ) { hideError ( ) ; hideElement ( "users-status" ) ; clearElement ( "site-users" ) ; for ( const user of users ) { const newItem = createUserRow ( user ) ; appendTo ( "site-users" , newItem ) ; } } }
Populate users on the stats page
Populate users on the stats page