fix hot bugs.

This commit is contained in:
Ahmed Bouhuolia
2020-04-26 03:09:33 +02:00
parent d14ff872d4
commit e01ad95ac3
31 changed files with 251 additions and 350 deletions

View File

@@ -7,12 +7,14 @@ export default function login({ form }) {
ApiService.post('auth/login', form).then(response => {
const { data } = response;
dispatch({type: t.LOGIN_CLEAR_ERRORS});
dispatch({ type: t.LOGIN_CLEAR_ERRORS });
if (data.token && data.user) {
dispatch({
type: t.LOGIN_SUCCESS,
user: data.user,
token: data.token,
payload: {
user: data.user,
token: data.token,
},
});
}
resolve(response);