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() {
|
||||
this.getArticles()
|
||||
}
|
||||
}
|
||||
|
||||
sortArticles = (sortType) => {
|
||||
// Implémenter la fonction sortArticles :
|
||||
sortArticles = (sortType) => {
|
||||
|
||||
let sorted;
|
||||
if (sortType === "name"){
|
||||
|
@ -72,7 +73,7 @@ sortArticles = (sortType) => {
|
|||
this.setState({onSortedCategories:false})
|
||||
})
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
getArticles = () => {
|
||||
axios.get('https://etud.insa-toulouse.fr/~proximo/v2/api/articles')
|
||||
|
@ -199,6 +200,7 @@ sortArticles = (sortType) => {
|
|||
this.handleCloseCategories()
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
render() {
|
||||
|
|
Loading…
Reference in a new issue