From 4e817c96475c22e9fd0a0bb2d4dd4d5c53d9c3e4 Mon Sep 17 00:00:00 2001 From: Leon Liang Date: Thu, 21 Nov 2019 20:09:47 -0500 Subject: [PATCH] integrated backend change, added pointer cursor --- functions/handlers/topic.js | 2 +- twistter-frontend/src/pages/user.js | 10 +++++++--- 2 files changed, 8 insertions(+), 4 deletions(-) diff --git a/functions/handlers/topic.js b/functions/handlers/topic.js index c2d2a57..bd7b437 100644 --- a/functions/handlers/topic.js +++ b/functions/handlers/topic.js @@ -49,7 +49,7 @@ exports.deleteTopic = (req, res) => { new_following = doc.data().followedTopics; // remove username from array new_following.forEach(function(follower, index) { - if (follower === `${req.body.topic}`) { + if (follower === `${req.body.unfollow}`) { new_following.splice(index, 1); } }); diff --git a/twistter-frontend/src/pages/user.js b/twistter-frontend/src/pages/user.js index 335b1cf..9896f7d 100644 --- a/twistter-frontend/src/pages/user.js +++ b/twistter-frontend/src/pages/user.js @@ -78,8 +78,11 @@ class user extends Component { }; handleDelete = topic => { + console.log(topic); axios - .delete(`/deleteTopic/${topic.id}`) + .post(`/deleteTopic`, { + unfollow: topic + }) .then(function() { location.reload(); }) @@ -91,7 +94,7 @@ class user extends Component { handleAddCircle = () => { axios .post("/putTopic", { - topic: this.state.newTopic + following: this.state.newTopic }) .then(function() { location.reload(); @@ -125,7 +128,7 @@ class user extends Component { axios .get("/getallPostsforUser") .then(res => { - console.log(res.data); + // console.log(res.data); this.setState({ posts: res.data }); @@ -269,6 +272,7 @@ class user extends Component { // iconStyle={classes.addCircle} clickable onClick={this.handleAddCircle} + cursor="pointer" />