Files
old-psihologija/client/src/scenes/Home/index.js

36 lines
864 B
JavaScript
Raw Normal View History

2019-05-24 10:14:41 +02:00
import React, { Component } from 'react';
class Home extends Component {
state = {
apiStatus: 'loading',
};
componentDidMount() {
fetch('/api')
.then(response => response.json())
.then(result => {
if (result.status === 1) {
this.setState({apiStatus: 'working'});
} else {
this.setState({apiStatus: 'NOT WORKING !'});
}
})
.catch(err => {
this.setState({apiStatus: `ERROR : ${err}`});
})
}
render () {
const {apiStatus} = this.state;
return (
<div>
<h3>CRM Integration</h3>
<hr/>
<h5>Integration API Status : {apiStatus}</h5>
</div>
);
}
2019-05-23 19:19:54 +02:00
}
2019-05-24 10:14:41 +02:00
export default Home;