loginUser(ctx, payload) {
    return new Promise((resolve, reject) => {
      axios
        .post("user/login", payload)
        .then(response => {
          if (response.data.access_token) {
            localStorage.setItem("token", response.data.access_token);
            localStorage.setItem("adminID", response.data.userId);
            ctx.commit("SET_LOGGEDIN", true);
            resolve(response);
          } else {
            reject(response);
          }
        })
        .catch(error => {
          reject(error);
        });
    });
  }
/**
    // User Login
    # Check If User Login
    # Add Token In Local Storage
    # Change User State Form Flase To True
    # If Not Login Return Errors
  **/
User Login
Check If User Login
Add Token In Local Storage
Change User State Form Flase To True
If Not Login Return Errors
User Login Check If User Login Add Token In Local Storage Change User State Form Flase To True If Not Login Return Errors
loginUser(ctx, payload) {
    return new Promise((resolve, reject) => {
      axios
        .post("user/login", payload)
        .then(response => {
          if (response.data.access_token) {
            localStorage.setItem("token", response.data.access_token);
            localStorage.setItem("adminID", response.data.userId);
            ctx.commit("SET_LOGGEDIN", true);
            resolve(response);
          } else {
            reject(response);
          }
        })
        .catch(error => {
          reject(error);
        });
    });
  }
loginUser ( ctx , payload ) { return new Promise ( ( resolve , reject ) => { axios . post ( "user/login" , payload ) . then ( response => { if ( response . data . access_token ) { localStorage . setItem ( "token" , response . data . access_token ) ; localStorage . setItem ( "adminID" , response . data . userId ) ; ctx . commit ( "SET_LOGGEDIN" , true ) ; resolve ( response ) ; } else { reject ( response ) ; } } ) . catch ( error => { reject ( error ) ; } ) ; } ) ; }
User Login
 Check If User Login
 Add Token In Local Storage
 Change User State Form Flase To True
 If Not Login Return Errors
User Login Check If User Login Add Token In Local Storage Change User State Form Flase To True If Not Login Return Errors