Hi everyone,
I try to do the list of features to add at the end of ravenous part 4.
One of them is saying “Clicking on a different sorting option automatically requeries the Yelp API, rather than having to manually click “Let’s Go” again” .
So i put searchYelp() to access the Yelp API in my handleSortByChange method like this :
handleSortByChange(sortByOptionValue) {
this.setState({
sortBy: sortByOptionValue
});
this.props.searchYelp(this.state.term, this.state.location, this.state.sortBy);
}
Is it the good way to resolve this ?
Because when i test and click on a sorting option, my businesses change on the page but not like it should be…ex: Highest Rated will not be in the good order with all the 20 businesses (only a few of them will work…this a very weird).