public/js/adminloginpage/adminloginpage.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 loginAdmin(adminData) {
      $.post("/api/admin/dashboard", adminData)
        .then((response) => {
          console.log("inside success");
          console.log(response)
          window.location.replace("/admin/dashboard");
        })
        .catch(err => {
          console.log("inside err");
          console.log(err);
        });
    }
function loginAdmin ( adminData ) { $ . post ( "/api/admin/dashboard" , adminData ) . then ( ( response ) => { console . log ( "inside success" ) ; console . log ( response ) window . location . replace ( "/admin/dashboard" ) ; } ) . catch ( err => { console . log ( "inside 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