project/src/main/webapp/event-details.js
/** Call doPost to register logged in user for event */
Call doPost to register logged in user for event
Call doPost to register logged in user for event
async function registerEvent(eventId, host) {
  const response = await fetch(
      '/register-event?' + new URLSearchParams({'eventId': eventId}),
      {method: 'POST'});
  const isHost = await getLoggedInUserIsHost(host);
  if (isHost) {
    $('.alert').slideDown();
    $('#signup-link').hide();
  } else {
    document.getElementById('signup-link').setAttribute('href', '');
    document.getElementById('signup-link').innerHTML =
        'You are signed up for this event.';
  }
}
async function registerEvent ( eventId , host ) { const response = await fetch ( '/register-event?' + new URLSearchParams ( { 'eventId' : eventId } ) , { method : 'POST' } ) ; const isHost = await getLoggedInUserIsHost ( host ) ; if ( isHost ) { $ ( '.alert' ) . slideDown ( ) ; $ ( '#signup-link' ) . hide ( ) ; } else { document . getElementById ( 'signup-link' ) . setAttribute ( 'href' , '' ) ; document . getElementById ( 'signup-link' ) . innerHTML = 'You are signed up for this event.' ; } }
Call doPost to register logged in user for event
Call doPost to register logged in user for event