39 lines
1.0 KiB
JavaScript
39 lines
1.0 KiB
JavaScript
|
import React, {Component} from "react";
|
||
|
|
||
|
class Acceuil extends Component {
|
||
|
constructor(props) {
|
||
|
super(props);
|
||
|
this.state = {
|
||
|
semestre: {},
|
||
|
students: [],
|
||
|
};
|
||
|
}
|
||
|
|
||
|
componentWillMount() {
|
||
|
fetch('https://scodoc.dev.net/ScoDoc/RT/Scolarite/Notes/formsemestre_list?format=json&formsemestre_id=SEM144', {
|
||
|
method: 'GET',
|
||
|
verify: false,
|
||
|
credentials: 'include',
|
||
|
})
|
||
|
.then(response =>
|
||
|
response.json().then(data => ({
|
||
|
data: data,
|
||
|
status: response.status
|
||
|
})
|
||
|
).then(res => {
|
||
|
this.setState({ semestre: res.data[0]});
|
||
|
console.log(res.data)
|
||
|
console.log(this.state.semestre)
|
||
|
}));
|
||
|
}
|
||
|
|
||
|
render() {
|
||
|
return (
|
||
|
<div className="wrapper">
|
||
|
<h1>{this.state.semestre.titre}</h1>
|
||
|
</div>
|
||
|
)
|
||
|
}
|
||
|
}
|
||
|
|
||
|
export default Acceuil
|