public/js/login.js
// loginUser does a post to our "api/login" route and if successful, redirects us the the members page
loginUser does a post to our "api/login" route and if successful, redirects us the the members page
loginUser does a post to our " api / login " route and if successful redirects us the the members page
function loginUser(email, password) {
    $.post("/api/login", {
      email: email,
      password: password,
    })
      .then(function () {
        window.location.replace("/reservations");
        console.log("am I getting to this point?");
      })
      .catch(function (err) {
        console.log(err);
      });
  }
function loginUser ( email , password ) { $ . post ( "/api/login" , { email : email , password : password , } ) . then ( function ( ) { window . location . replace ( "/reservations" ) ; console . log ( "am I getting to this point?" ) ; } ) . catch ( function ( err ) { console . log ( err ) ; } ) ; }
loginUser does a post to our "api/login" route and if successful, redirects us the the members page
loginUser does a post to our " api / login " route and if successful redirects us the the members page
// If there's an error, log the error