Movie object now uses http functions when submitting a post for a movie.
This commit is contained in:
@@ -7,6 +7,10 @@ import movieStyle from './styles/movieObjectStyle.jsx';
|
|||||||
|
|
||||||
var MediaQuery = require('react-responsive');
|
var MediaQuery = require('react-responsive');
|
||||||
|
|
||||||
|
import RequestButton from './buttons/request_button.jsx';
|
||||||
|
|
||||||
|
import { fetchJSON } from './http.jsx';
|
||||||
|
|
||||||
class MovieObject {
|
class MovieObject {
|
||||||
constructor(object) {
|
constructor(object) {
|
||||||
this.id = object.id;
|
this.id = object.id;
|
||||||
@@ -27,9 +31,13 @@ class MovieObject {
|
|||||||
|
|
||||||
requestMovie() {
|
requestMovie() {
|
||||||
// fetch('http://localhost:31459/api/v1/plex/request/' + this.id + '?type='+this.type, {
|
// fetch('http://localhost:31459/api/v1/plex/request/' + this.id + '?type='+this.type, {
|
||||||
fetch('https://apollo.kevinmidboe.com/api/v1/plex/request/' + this.id + '?type='+this.type, {
|
// fetch('https://apollo.kevinmidboe.com/api/v1/plex/request/' + this.id + '?type='+this.type, {
|
||||||
method: 'POST'
|
// method: 'POST'
|
||||||
});
|
// });
|
||||||
|
fetchJSON('https://apollo.kevinmidboe.com/api/v1/plex/request/' + this.id + '?type='+this.type, 'POST')
|
||||||
|
.then((response) => {
|
||||||
|
console.log(response);
|
||||||
|
})
|
||||||
|
|
||||||
notify.show(this.title + ' requested!', 'success', 3000);
|
notify.show(this.title + ' requested!', 'success', 3000);
|
||||||
}
|
}
|
||||||
@@ -61,6 +69,7 @@ class MovieObject {
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
// TODO add request button class
|
||||||
return (
|
return (
|
||||||
<div key={element_key}>
|
<div key={element_key}>
|
||||||
<Notifications />
|
<Notifications />
|
||||||
@@ -90,6 +99,7 @@ class MovieObject {
|
|||||||
|
|
||||||
|
|
||||||
<span className='imdbLogo'>
|
<span className='imdbLogo'>
|
||||||
|
|
||||||
</span>
|
</span>
|
||||||
|
|
||||||
<div style={movieStyle.buttons}>
|
<div style={movieStyle.buttons}>
|
||||||
|
|||||||
Reference in New Issue
Block a user