From 2fc37e3e34d25183fe7c75df0181e0c3e92db21a Mon Sep 17 00:00:00 2001 From: shobhitm23 Date: Tue, 29 Oct 2019 13:45:36 -0400 Subject: [PATCH] Added link in index.js --- functions/index.js | 5 ++++- twistter-frontend/src/pages/user.js | 2 +- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/functions/index.js b/functions/index.js index 737d44f..97ab31b 100644 --- a/functions/index.js +++ b/functions/index.js @@ -44,7 +44,7 @@ app.get("/user", fbAuth, getAuthenticatedUser); /*------------------------------------------------------------------* * handlers/post.js * *------------------------------------------------------------------*/ -const { getallPostsforUser, putPost +const { getallPostsforUser, putPost, getAllPosts } = require("./handlers/post"); app.get("/getallPostsforUser", getallPostsforUser); @@ -52,6 +52,9 @@ app.get("/getallPostsforUser", getallPostsforUser); // Adds one post to the database app.post("/putPost", fbAuth, putPost); +// Displays posts on home page +app.post("/getAllPosts", getAllPosts ); + /*------------------------------------------------------------------* * handlers/topic.js * *------------------------------------------------------------------*/ diff --git a/twistter-frontend/src/pages/user.js b/twistter-frontend/src/pages/user.js index 8d0ca4d..7ea0871 100644 --- a/twistter-frontend/src/pages/user.js +++ b/twistter-frontend/src/pages/user.js @@ -71,7 +71,7 @@ class user extends Component { }) }) .catch(err => console.log(err)); - axios.get('/posts') + axios.get('/getAllPosts') .then(res => { this.setState({ posts: res.data