From d9dd7ec1534d805cd97ac86e8a10e02901c4f8da Mon Sep 17 00:00:00 2001 From: KevinMidboe Date: Wed, 20 Sep 2017 10:26:30 +0200 Subject: [PATCH] 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. --- client/app/components/SearchRequest.jsx | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/client/app/components/SearchRequest.jsx b/client/app/components/SearchRequest.jsx index 5ee5d20..a6008c8 100644 --- a/client/app/components/SearchRequest.jsx +++ b/client/app/components/SearchRequest.jsx @@ -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)) }) } })