src/static/js/admin-suspension.js
// Populate data on the suspension page
Populate data on the suspension page
Populate data on the suspension page
async function populateSuspension() {
  const suspensionURL = "/api/suspendedUsers";
  let suspended = null;
  try {
    suspended = await fetchJSON(suspensionURL);
  } catch (err) {
    showError("Failed to update suspended users");
  }
  if (suspended) {
    hideError();
    hideElement("suspended-status");
    clearElement("suspended");
    for (const user of suspended) {
      const newItem = createSuspensionRow(user);
      appendTo("suspended", newItem);
    }
  }
}
async function populateSuspension ( ) { const suspensionURL = "/api/suspendedUsers" ; let suspended = null ; try { suspended = await fetchJSON ( suspensionURL ) ; } catch ( err ) { showError ( "Failed to update suspended users" ) ; } if ( suspended ) { hideError ( ) ; hideElement ( "suspended-status" ) ; clearElement ( "suspended" ) ; for ( const user of suspended ) { const newItem = createSuspensionRow ( user ) ; appendTo ( "suspended" , newItem ) ; } } }
Populate data on the suspension page
Populate data on the suspension page