project/src/main/webapp/event-details.js
/**
 * Should the volunteering opportunities of the event card and if the
 * eventHost is the current user, add the edit link for each opportunity.
 * @param {Object} opportunities
 * @param {string} eventHost email of the host of the event
 * @param {boolean} isHost
 */
Should the volunteering opportunities of the event card and if the
eventHost is the current user, add the edit link for each opportunity.
@param {Object} opportunities
@param {string} eventHost email of the host of the event
@param {boolean} isHost
Should the volunteering opportunities of the event card and if the eventHost is the current user add the edit link for each opportunity . @param { Object } opportunities @param { string } eventHost email of the host of the event @param { boolean } isHost
async function showVolunteeringOpportunities(opportunities, eventHost, isHost) {
  for (const key in opportunities) {
    if (opportunities.hasOwnProperty(key)) {
      const volunteers =
          await getVolunteersByOpportunityId(opportunities[key].opportunityId);
      $('#volunteering-opportunities .card .card-body')
          .append(getListItemForOpportunity(
              opportunities[key].opportunityId,
              opportunities[key].name,
              opportunities[key].numSpotsLeft,
              opportunities[key].requiredSkills, volunteers, eventHost,
              isHost));
      buildAsLabels(
          `#oppportunity-id-${opportunities[key].opportunityId} #skills`,
          opportunities[key].requiredSkills, 'skills');
    }
  }
}
async function showVolunteeringOpportunities ( opportunities , eventHost , isHost ) { for ( const key in opportunities ) { if ( opportunities . hasOwnProperty ( key ) ) { const volunteers = await getVolunteersByOpportunityId ( opportunities [ key ] . opportunityId ) ; $ ( '#volunteering-opportunities .card .card-body' ) . append ( getListItemForOpportunity ( opportunities [ key ] . opportunityId , opportunities [ key ] . name , opportunities [ key ] . numSpotsLeft , opportunities [ key ] . requiredSkills , volunteers , eventHost , isHost ) ) ; buildAsLabels ( ` ${ opportunities [ key ] . opportunityId } ` , opportunities [ key ] . requiredSkills , 'skills' ) ; } } }
Should the volunteering opportunities of the event card and if the
 eventHost is the current user, add the edit link for each opportunity.
Should the volunteering opportunities of the event card and if the eventHost is the current user add the edit link for each opportunity .