Begin using async/await.

This commit is contained in:
kialam
2018-11-12 13:24:17 -05:00
parent 06470a0e65
commit f520be71d6
5 changed files with 28 additions and 44 deletions

View File

@@ -22,6 +22,7 @@ import {
import { global_breakpoint_md as breakpointMd } from '@patternfly/react-tokens';
import api from './api';
import { API_LOGOUT } from './endpoints';
// import About from './components/About';
import LogoutButton from './components/LogoutButton';
@@ -79,11 +80,9 @@ class App extends React.Component {
this.setState({ activeGroup: 'views_group', activeItem: 'views_group_dashboard' });
}
onDevLogout = () => {
api.logout()
.then(() => {
this.setState({ activeGroup: 'views_group', activeItem: 'views_group_dashboard' });
});
onDevLogout = async () => {
await api.BaseGet(API_LOGOUT);
this.setState({ activeGroup: 'views_group', activeItem: 'views_group_dashboard' });
}
render () {