diff --git a/twistter-frontend/src/pages/Home.js b/twistter-frontend/src/pages/Home.js
index 85043e7..0d919c2 100644
--- a/twistter-frontend/src/pages/Home.js
+++ b/twistter-frontend/src/pages/Home.js
@@ -57,14 +57,28 @@ class Home extends Component {
})
.catch(err => console.log(err));
+ let allPosts;
let postPromise = axios
.get("/getallPosts")
.then(res => {
// 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({
- posts: res.data
+ posts: allPosts
});
})
+
.catch(err => console.log(err));
Promise.all([userPromise, postPromise])
@@ -141,7 +155,7 @@ class Home extends Component {
console.log(hiddenBool);
let postMarkup = this.state.posts ? ( this.state.following === undefined || this.state.following === null ? You aren't following anybody right now :
- 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") ? (
@@ -190,7 +204,7 @@ class Home extends Component {
{/* */}
- Likes {post.likeCount} Comments {post.commentCount}
+ {/* Likes {post.likeCount} Comments {post.commentCount} */}