async function mailinglist_seed_domain_list()

in htdocs/js/selfserve.js [266:280]


async function mailinglist_seed_domain_list(prefs) {
  // Seeds the dropdown with current mailing list domains
  const domainlist = document.getElementById('domainpart');
  const pubresp = await GET("/api/public");
  const pubdata = await pubresp.json();
  for (const [project, domain] of Object.entries(pubdata.mail_domains)) {
    // Only add domain if user can request lists for it. Either by being root, or by being on a PMC
    if (prefs.root || prefs.pmcs.includes(project)) {
      const opt = document.createElement("option");
      opt.text = domain;
      opt.value = domain;
      domainlist.appendChild(opt);
    }
  }
}