src/static/js/admin-variables.js
// Populate data on the variables page
Populate data on the variables page
Populate data on the variables page
async function populateVariables() {
  const variablesURL = "/api/adminVariables";
  let variables = null;
  try {
    variables = await fetchJSON(variablesURL);
  } catch (err) {
    showError("Failed to update variables");
  }
  if (variables) {
    hideError();
    clearElement("variables");
    for (const variable of variables) {
      const newItem = createVariable(variable);
      appendTo("variables", newItem);
    }
  }
}
async function populateVariables ( ) { const variablesURL = "/api/adminVariables" ; let variables = null ; try { variables = await fetchJSON ( variablesURL ) ; } catch ( err ) { showError ( "Failed to update variables" ) ; } if ( variables ) { hideError ( ) ; clearElement ( "variables" ) ; for ( const variable of variables ) { const newItem = createVariable ( variable ) ; appendTo ( "variables" , newItem ) ; } } }
Populate data on the variables page
Populate data on the variables page