project/src/main/webapp/event-details.js
/**
 * Adds the volunteering opportunities for which the number of attendee spots
 * is greater than 0 to the dropdown selection.
 * @param {Object[]} opportunities to display in dropdown
 */
Adds the volunteering opportunities for which the number of attendee spots
is greater than 0 to the dropdown selection.
@param {Object[]} opportunities to display in dropdown
Adds the volunteering opportunities for which the number of attendee spots is greater than 0 to the dropdown selection . @param { Object [] } opportunities to display in dropdown
async function populateOpportunitiesDropdown(opportunities) {
  if (opportunities.length) {
    for (const key in opportunities) {
      if (opportunities.hasOwnProperty(key) && opportunities[key].numSpotsLeft > 0) {
        $('#opportunities-options')
            .append(getOptionForOpportunity(
                opportunities[key].opportunityId, opportunities[key].name));
      }
    }
  } else {
    document.getElementById('volopp-container').remove();
    document.getElementById('volunteering-opportunities').remove();
  }
}
async function populateOpportunitiesDropdown ( opportunities ) { if ( opportunities . length ) { for ( const key in opportunities ) { if ( opportunities . hasOwnProperty ( key ) && opportunities [ key ] . numSpotsLeft > 0 ) { $ ( '#opportunities-options' ) . append ( getOptionForOpportunity ( opportunities [ key ] . opportunityId , opportunities [ key ] . name ) ) ; } } } else { document . getElementById ( 'volopp-container' ) . remove ( ) ; document . getElementById ( 'volunteering-opportunities' ) . remove ( ) ; } }
Adds the volunteering opportunities for which the number of attendee spots
 is greater than 0 to the dropdown selection.
Adds the volunteering opportunities for which the number of attendee spots is greater than 0 to the dropdown selection .