diff --git a/client/app/static/browse_articles.jsx b/client/app/static/browse_articles.jsx
index 74a6684..be396a1 100644
--- a/client/app/static/browse_articles.jsx
+++ b/client/app/static/browse_articles.jsx
@@ -8,6 +8,33 @@ class BrowseArticles extends React.Component {
this.state = {error: "", articles: [], url: "/api/articles"};
}
+ componentDidMount() {
+ console.log("Component Mounted!");
+ var myHeaders = new Headers({
+ "Content-Type": "application/x-www-form-urlencoded",
+ "x-access-token": localStorage.getItem('userToken')
+ });
+ var myInit = { method: 'GET',
+ headers: myHeaders,
+ };
+ var that = this;
+ var url = '/api/articles';
+ console.log(url);
+ fetch(url,myInit)
+ .then(function(response) {
+ console.log(response);
+ return response.json();
+ })
+ .then(function(response) {
+ if(response.error.error)
+ that.setState({error: response.error.message})
+ else {
+ that.setState({articles: response.data})
+ console.log(that.state.articles);
+ }
+ console.log(response);
+ });
+ }
componentWillReceiveProps(nextProps) {
console.log('PREV PROPS');
diff --git a/client/app/static/browse_topics.jsx b/client/app/static/browse_topics.jsx
index 7038fc7..624aff2 100644
--- a/client/app/static/browse_topics.jsx
+++ b/client/app/static/browse_topics.jsx
@@ -50,10 +50,18 @@ class BrowseTopics extends React.Component {
return
;
}
else {
- return(
-
+ return(
+
+
+
+
+
+
+