project/src/main/webapp/event-details.js
/**
 * Adds the edit button for the host and removes the register button
 * @param {Object} eventHost email of the host of the event
 */
Adds the edit button for the host and removes the register button
@param {Object} eventHost email of the host of the event
Adds the edit button for the host and removes the register button @param { Object } eventHost email of the host of the event
async function configureRegisterAndEditButtons(eventHost, eventId) {
  const loggedInUserIsHost = await getLoggedInUserIsHost(eventHost);
  populateVolunteeringOpportunitiesUI(eventHost, loggedInUserIsHost);
  if (loggedInUserIsHost) {
    const editContainer = '#edit-container .card .card-body #edit-container-2';
    addHostButtons(editContainer, eventId);
    $('#signup-link').hide();
    $('#volopp-container').hide();
  } else {
    setSignupAction();
    $('#edit-container').hide();
    $('#details')
        .append(`<a id="signup-link" href="/event-details.html?eventId=${
            eventId}&register=true" 
                type="button" class="btn btn-primary">Register</a>`);
  }
}
async function configureRegisterAndEditButtons ( eventHost , eventId ) { const loggedInUserIsHost = await getLoggedInUserIsHost ( eventHost ) ; populateVolunteeringOpportunitiesUI ( eventHost , loggedInUserIsHost ) ; if ( loggedInUserIsHost ) { const editContainer = '#edit-container .card .card-body #edit-container-2' ; addHostButtons ( editContainer , eventId ) ; $ ( '#signup-link' ) . hide ( ) ; $ ( '#volopp-container' ) . hide ( ) ; } else { setSignupAction ( ) ; $ ( '#edit-container' ) . hide ( ) ; $ ( '#details' ) . append ( ` ${ eventId } ` ) ; } }
Adds the edit button for the host and removes the register button
 @param {Object} eventHost email of the host of the event
Adds the edit button for the host and removes the register button @param { Object } eventHost email of the host of the event