1constructor(props) {
2 super(props);
3 this.state = {
4 clients: [],
5 Code: props.match.params.Code
6 };
7componentDidMount() {
8 axios.get('http://localhost:4000/app/viewclient/' + this.props.match.params.Code).then(function(response) {
9 if (response.status >= 400) {
10 throw new Error("Bad response from server");
11 }
12 return response.json();
13 }).then(function(data) {
14 if (data === "success") {
15 this.setState({ msg: "User has been deleted." });
16 }
17 }).catch(function(err) {
18 console.log(err)
19 });
20 }