It is now expected to get a JSON object were the items we want to display are listed in results object within, this is now reflected in the client by iterating over data.results not just data.

This commit is contained in:
2017-09-20 10:26:30 +02:00
parent ae66e9a684
commit d9dd7ec153

View File

@@ -108,10 +108,9 @@ class SearchRequest extends React.Component {
.then(data => { // Parse the data of the JSON response
// If it is something here it updates the state variable with the HTML list of all
// movie objects that where returned by the search request
console.log(data)
if (data.length > 0) {
if (data.results.length > 0) {
this.setState({
responseMovieList: data.map(item => this.createMovieObjects(item))
responseMovieList: data.results.map(item => this.createMovieObjects(item))
})
}
})