Merge branch 'master' of https://git.etud.insa-toulouse.fr/bamarty/Site-Proximo
This commit is contained in:
commit
44ae9f21d5
1 changed files with 40 additions and 38 deletions
|
@ -42,9 +42,10 @@ export default class Stock extends React.Component {
|
||||||
|
|
||||||
componentDidMount() {
|
componentDidMount() {
|
||||||
this.getArticles()
|
this.getArticles()
|
||||||
}
|
}
|
||||||
|
|
||||||
sortArticles = (sortType) => {
|
// Implémenter la fonction sortArticles :
|
||||||
|
sortArticles = (sortType) => {
|
||||||
|
|
||||||
let sorted;
|
let sorted;
|
||||||
if (sortType === "name"){
|
if (sortType === "name"){
|
||||||
|
@ -72,7 +73,7 @@ sortArticles = (sortType) => {
|
||||||
this.setState({onSortedCategories:false})
|
this.setState({onSortedCategories:false})
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
getArticles = () => {
|
getArticles = () => {
|
||||||
axios.get('https://etud.insa-toulouse.fr/~proximo/v2/api/articles')
|
axios.get('https://etud.insa-toulouse.fr/~proximo/v2/api/articles')
|
||||||
|
@ -199,6 +200,7 @@ sortArticles = (sortType) => {
|
||||||
this.handleCloseCategories()
|
this.handleCloseCategories()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
render() {
|
render() {
|
||||||
|
|
Loading…
Reference in a new issue