Compare commits

..

14 Commits

Author SHA1 Message Date
Aaron Sun
5a7f80ab34 PROJECT COMPLETED!!!!! 2019-12-10 23:42:36 -05:00
Aaron Sun
db6b147c40 PROJECT COMPLETED!!!!! 2019-12-10 23:41:50 -05:00
Aaron Sun
e3593e2f29 Left-aligned the text in posts 2019-11-29 21:11:10 -08:00
Aaron Sun
4b440d28de Fixed a small bug in sorting userline posts 2019-11-29 20:17:21 -08:00
Aaron Sun
81593cee52 Posts are now sorted by date 2019-11-29 20:02:13 -08:00
Aaron Sun
1482830131 Pulled latest version from master and fixed all conflicts 2019-11-24 17:08:13 -08:00
Aaron Sun
ad0b21e629 Tested likes and shares via hardcode 2019-11-21 17:13:33 -05:00
Aaron Sun
e1343d503c Made the date in posts look prettier 2019-11-19 23:32:37 -05:00
Aaron Sun
54ba36abeb All done with only showing posts user is interested in 2019-11-19 12:25:55 -05:00
Aaron Sun
953d58ea12 Can filter posts via subcollection iteration but from only 1 user 2019-11-18 23:45:14 -05:00
Aaron Sun
b9ca0dc492 Modified code structure for filter posts 2019-11-18 22:17:33 -05:00
Aaron Sun
4d4b085a2b Can filter posts via hardcoded topics 2019-11-18 22:01:28 -05:00
Aaron Sun
1a2f269466 Filtered timeline posts to only followers 2019-11-17 22:36:52 -05:00
Aaron Sun
6184a22607 Fixed conflicts with Sprint 2 checkpoint and the most up-to-date version 2019-11-17 10:32:59 -05:00
5 changed files with 36 additions and 1152 deletions

View File

@@ -178,10 +178,10 @@ exports.getOtherUsersPosts = (req, res) => {
.collection("posts") .collection("posts")
.where("userHandle", "==", req.body.handle); .where("userHandle", "==", req.body.handle);
post_query += admin // post_query += admin
.firestore() // .firestore()
.collection("posts") // .collection("posts")
.where("microBlogTitle", "==", "Alert").where("userHandle", "==", "Admin"); // .where("microBlogTitle", "==", "Alert").where("userHandle", "==", "Admin");
post_query post_query
.get() .get()

View File

@@ -1212,7 +1212,10 @@ exports.addSubscription = (req, res) => {
return res.status(500).json({ err }); return res.status(500).json({ err });
}); });
// return res.status(200).json({ message: "ok" }); // return res.status(200).json({ message: "ok" });
}); })
.catch((error) => {
return res.status(400).json({message: "That user doesn't exist", error});
})
}; };
exports.getSubs = (req, res) => { exports.getSubs = (req, res) => {

File diff suppressed because it is too large Load Diff

View File

@@ -45,5 +45,5 @@
"last 1 safari version" "last 1 safari version"
] ]
}, },
"proxy": "http://localhost:5001/twistter-e4649/us-central1/api" "proxy": "https://us-central1-twistter-e4649.cloudfunctions.net/api"
} }

View File

@@ -57,14 +57,28 @@ class Home extends Component {
}) })
.catch(err => console.log(err)); .catch(err => console.log(err));
let allPosts;
let postPromise = axios let postPromise = axios
.get("/getallPosts") .get("/getallPosts")
.then(res => { .then(res => {
// console.log(res.data); // console.log(res.data);
// this.setState({
// posts: res.data
// });
allPosts = res.data;
// console.log(allPosts)
return axios.get("/getAlert")
})
.then((res) => {
// console.log(res.data)
// res.data.forEach((adminAlert) => {
// allPosts.push(adminAlert);
// })
this.setState({ this.setState({
posts: res.data posts: allPosts
}); });
}) })
.catch(err => console.log(err)); .catch(err => console.log(err));
Promise.all([userPromise, postPromise]) Promise.all([userPromise, postPromise])
@@ -141,7 +155,7 @@ class Home extends Component {
console.log(hiddenBool); console.log(hiddenBool);
let postMarkup = this.state.posts ? ( this.state.following === undefined || this.state.following === null ? <Typography>You aren't following anybody right now</Typography> : let postMarkup = this.state.posts ? ( this.state.following === undefined || this.state.following === null ? <Typography>You aren't following anybody right now</Typography> :
this.state.posts.map(post => !post.hidden && this.state.following && this.state.following.includes(post.userHandle) ? ( this.state.posts.map(post => !post.hidden && this.state.following && (this.state.following.includes(post.userHandle) || post.userHandle === "Admin") ? (
<Card className={classes.card} key={post.postId}> <Card className={classes.card} key={post.postId}>
<CardContent> <CardContent>
<Typography> <Typography>
@@ -190,7 +204,7 @@ class Home extends Component {
{/* <button>Quote</button> */} {/* <button>Quote</button> */}
<Typography variant="body2" color={"textSecondary"}>Likes {post.likeCount} Comments {post.commentCount}</Typography> {/* <Typography variant="body2" color={"textSecondary"}>Likes {post.likeCount} Comments {post.commentCount}</Typography> */}
</CardContent> </CardContent>
</Card> </Card>