diff --git a/client/app/components/admin/Admin.jsx b/client/app/components/admin/Admin.jsx index 50047b1..d2faeef 100644 --- a/client/app/components/admin/Admin.jsx +++ b/client/app/components/admin/Admin.jsx @@ -20,10 +20,16 @@ class AdminComponent extends React.Component { this.state = { requested_objects: '', } + + this.updateHandler = this.updateHandler.bind(this) } // Fetches all requested elements and updates the state with response componentWillMount() { + this.fetchRequestedItems() + } + + fetchRequestedItems() { fetchJSON('https://apollo.kevinmidboe.com/api/v1/plex/requests/all', 'GET') .then(result => { this.setState({ @@ -32,6 +38,10 @@ class AdminComponent extends React.Component { }) } + updateHandler() { + this.fetchRequestedItems() + } + // Displays loginform if not logged in and passes response from // api call to sidebar and infoPanel through props verifyLoggedIn() { @@ -52,18 +62,19 @@ class AdminComponent extends React.Component { return (
+
+ +
-
- -
) }