Changed movieObject ot pass full object, not just it's id when clicked

This commit is contained in:
Kevin Midbøe
2017-07-16 10:51:02 +02:00
parent 29e575cbf1
commit c97ab972ef

View File

@@ -11,8 +11,8 @@ class MovieObject {
this.overview = object.overview; this.overview = object.overview;
} }
requestExisting(id) { requestExisting(movie) {
console.log('Exists', id) console.log('Exists', movie)
} }
requestMovie(id) { requestMovie(id) {
@@ -33,9 +33,9 @@ class MovieObject {
returnList.push(<img src={posterPath}></img>); returnList.push(<img src={posterPath}></img>);
if (this.matchedInPlex) { if (this.matchedInPlex) {
returnList.push(<button onClick={() => this.requestExisting(this.id)}>Request anyway</button>) returnList.push(<button onClick={() => this.requestExisting(this)}>Request anyway</button>)
} else { } else {
returnList.push(<button onClick={() => this.requestMovie(this.id)}>Request</button>) returnList.push(<button onClick={() => this.requestMovie(this)}>Request</button>)
} }
returnList.push(<span>{this.overview}</span>); returnList.push(<span>{this.overview}</span>);