call get setttings path on user login
This commit is contained in:
parent
875a45451a
commit
8c35449ce4
|
@ -2,6 +2,7 @@ import _ from 'lodash';
|
|||
|
||||
import API from 'lib-app/api-call';
|
||||
import AdminDataActions from 'actions/admin-data-actions';
|
||||
import ConfigActions from 'actions/config-actions';
|
||||
import sessionStore from 'lib-app/session-store';
|
||||
import store from 'app/store';
|
||||
|
||||
|
@ -16,11 +17,13 @@ export default {
|
|||
path: '/user/login',
|
||||
data: _.extend(loginData, {remember: loginData.remember * 1})
|
||||
}).then((result) => {
|
||||
store.dispatch(this.getUserData(result.data.userId, result.data.token, result.data.staff)).then(() => {
|
||||
if(result.data.staff) {
|
||||
store.dispatch(AdminDataActions.retrieveCustomResponses());
|
||||
}
|
||||
});
|
||||
store.dispatch(this.getUserData(result.data.userId, result.data.token, result.data.staff))
|
||||
.then(() => store.dispatch(ConfigActions.updateData()))
|
||||
.then(() => {
|
||||
if(result.data.staff) {
|
||||
store.dispatch(AdminDataActions.retrieveCustomResponses());
|
||||
}
|
||||
});
|
||||
|
||||
resolve(result);
|
||||
}).catch((result) => {
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
import React from 'react';
|
||||
import _ from 'lodash';
|
||||
|
||||
import {dispatch} from 'app/store';
|
||||
import store from 'app/store';
|
||||
import SessionActions from 'actions/session-actions';
|
||||
import i18n from 'lib-app/i18n';
|
||||
|
||||
|
@ -65,7 +65,7 @@ class DashboardMenu extends React.Component {
|
|||
if (itemIndex < this.getDashboardRoutes().length) {
|
||||
this.goToPathByIndex(itemIndex)
|
||||
} else {
|
||||
dispatch(SessionActions.logout());
|
||||
store.dispatch(SessionActions.logout());
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue