export const LOGIN_SUCCESS = "LOGIN_SUCCESS";
export const LOGIN_FAIL = "LOGIN_FAIL";


export const login = (username, password) => (dispatch) => {
	let data = dataUser.filter((value) => value.username === username && value.password === password);
	if (!data.length) dispatch({ type: LOGIN_FAIL });
	data = data[0];
	localStorage.setItem("userInfo", JSON.stringify(data));
	dispatch({ type: LOGIN_SUCCESS, payload: data });
};
