integrated backend change, added pointer cursor

This commit is contained in:
Leon Liang 2019-11-21 20:09:47 -05:00
parent 7976110e2b
commit 4e817c9647
2 changed files with 8 additions and 4 deletions

View File

@ -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);
}
});

View File

@ -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"
/>
</Grid>
</Grid>