Compare commits

...

8 Commits

Author SHA1 Message Date
dependabot[bot]
c0df7c7752 Bump tmpl from 1.0.4 to 1.0.5 in /twistter-frontend
Bumps [tmpl](https://github.com/daaku/nodejs-tmpl) from 1.0.4 to 1.0.5.
- [Release notes](https://github.com/daaku/nodejs-tmpl/releases)
- [Commits](https://github.com/daaku/nodejs-tmpl/commits/v1.0.5)

---
updated-dependencies:
- dependency-name: tmpl
  dependency-type: indirect
...

Signed-off-by: dependabot[bot] <support@github.com>
2021-09-22 03:01:13 +00:00
DreamCoder23
b9cbd610a9 Update README.md 2020-10-11 23:17:34 -07:00
daabbf80f6 Actually fix deploy error 2019-12-06 14:58:51 -05:00
f9acefaafb Fixed deploy error 2019-12-06 14:55:01 -05:00
948eff32c2 Fix 2019-12-06 14:26:42 -05:00
6de219505a Fix admin alert posts displaying 2019-12-06 14:25:05 -05:00
7132a2ab45 Fix error in getOtherUsersPosts 2019-12-06 14:10:17 -05:00
5474543af4 add catch in addSubscription 2019-12-06 13:56:48 -05:00
5 changed files with 44 additions and 1159 deletions

View File

@@ -1,2 +1,2 @@
# CS307-Team24
CS307 Team 24 Twistter website.
CS307 Team 24 Twistter website

View File

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

View File

@@ -1,5 +1,6 @@
/* eslint-disable promise/catch-or-return */
/* eslint-disable promise/always-return */
/* eslint-disable prefer-promise-reject-error */
const { admin, db } = require("../util/admin");
const config = require("../util/config");
@@ -866,10 +867,10 @@ oneWayCheck = (userA, userB) => {
if (dmRecipient === userB) {
console.log(`You already have a DM with ${userB}`);
// reject(new Error(`You already have a DM with ${userB}`));
reject({
code: 400,
message: `You already have a DM with that user`
});
let e = new Error(`You already have a DM with that user`);
e.code = 400,
e.message = `You already have a DM with that user`
reject(e);
return;
}
});
@@ -1212,7 +1213,10 @@ exports.addSubscription = (req, res) => {
return res.status(500).json({ err });
});
// 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) => {

File diff suppressed because it is too large Load Diff

View File

@@ -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 ? <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}>
<CardContent>
<Typography>
@@ -190,7 +204,7 @@ class Home extends Component {
{/* <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>
</Card>