Compare commits
10 Commits
lastfix
...
dependabot
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
d569877edf | ||
|
|
d1f42aa5cd | ||
|
|
f118ed76d1 | ||
|
|
b9cbd610a9 | ||
| daabbf80f6 | |||
| f9acefaafb | |||
| 948eff32c2 | |||
| 6de219505a | |||
| 7132a2ab45 | |||
| 5474543af4 |
14
README.md
@@ -1,2 +1,14 @@
|
||||
# CS307-Team24
|
||||
CS307 Team 24 Twistter website.
|
||||
CS307 Team 24 Twistter website
|
||||
|
||||
### Images
|
||||
<p>
|
||||
<img alt="00.png" src="./screenshots/00.png" width="1000">
|
||||
<img alt="01.png" src="./screenshots/01.png" width="1000">
|
||||
<img alt="02.png" src="./screenshots/02.png" width="1000">
|
||||
<img alt="03.png" src="./screenshots/03.png" width="1000">
|
||||
<img alt="04.png" src="./screenshots/04.png" width="1000">
|
||||
<img alt="05.png" src="./screenshots/05.png" width="1000">
|
||||
<img alt="06.png" src="./screenshots/06.png" width="1000">
|
||||
<img alt="07.png" src="./screenshots/07.png" width="1000">
|
||||
</p>
|
||||
|
||||
@@ -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()
|
||||
|
||||
@@ -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) => {
|
||||
|
||||
BIN
screenshots/00.png
Normal file
|
After Width: | Height: | Size: 38 KiB |
BIN
screenshots/01.png
Normal file
|
After Width: | Height: | Size: 37 KiB |
BIN
screenshots/02.png
Normal file
|
After Width: | Height: | Size: 34 KiB |
BIN
screenshots/03.png
Normal file
|
After Width: | Height: | Size: 22 KiB |
BIN
screenshots/04.png
Normal file
|
After Width: | Height: | Size: 184 KiB |
BIN
screenshots/05.png
Normal file
|
After Width: | Height: | Size: 166 KiB |
BIN
screenshots/06.png
Normal file
|
After Width: | Height: | Size: 14 KiB |
BIN
screenshots/07.png
Normal file
|
After Width: | Height: | Size: 42 KiB |
1159
twistter-frontend/package-lock.json
generated
@@ -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>
|
||||
|
||||