github.com/muhammedhassanm/blockchain@v0.0.0-20200120143007-697261defd4d/blockapps-ba-master/ui/src/scenes/Login/login.actions.js (about)

     1  export const USER_LOGIN_SUBMIT = 'USER_LOGIN_SUBMIT';
     2  export const USER_LOGIN_SUCCESS = 'USER_LOGIN_SUCCESS';
     3  export const USER_LOGIN_FAILURE = 'USER_LOGIN_FAILURE';
     4  export const USER_LOGOUT = 'USER_LOGOUT';
     5  
     6  export const userLoginSubmit = function(username, password) {
     7    return {
     8      type: USER_LOGIN_SUBMIT,
     9      username,
    10      password
    11    }
    12  };
    13  
    14  export const userLoginSuccess = function(username, role) {
    15    return {
    16      type: USER_LOGIN_SUCCESS,
    17      username: username,
    18      role: role
    19    }
    20  };
    21  
    22  export const userLoginFailure = function(error) {
    23    return {
    24      type: USER_LOGIN_FAILURE,
    25      error: error
    26    }
    27  };
    28  
    29  export const userLogout = function() {
    30    return {
    31      type: USER_LOGOUT,
    32    }
    33  };