Compare commits
10 Commits
lastfix
...
dependabot
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
e9000ba252 | ||
|
|
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) => {
|
||||
|
||||
29
functions/package-lock.json
generated
@@ -596,8 +596,7 @@
|
||||
"balanced-match": {
|
||||
"version": "1.0.0",
|
||||
"resolved": "https://registry.npmjs.org/balanced-match/-/balanced-match-1.0.0.tgz",
|
||||
"integrity": "sha1-ibTRmasr7kneFk6gK4nORi1xt2c=",
|
||||
"dev": true
|
||||
"integrity": "sha1-ibTRmasr7kneFk6gK4nORi1xt2c="
|
||||
},
|
||||
"base64-js": {
|
||||
"version": "1.3.1",
|
||||
@@ -647,7 +646,6 @@
|
||||
"version": "1.1.11",
|
||||
"resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-1.1.11.tgz",
|
||||
"integrity": "sha512-iCuPHDFgrHX7H2vEI/5xpz07zSHB00TpugqhmYtVmMO6518mCuRMoOYFldEBl0g187ufozdaHgWKcYFb61qGiA==",
|
||||
"dev": true,
|
||||
"requires": {
|
||||
"balanced-match": "^1.0.0",
|
||||
"concat-map": "0.0.1"
|
||||
@@ -673,6 +671,14 @@
|
||||
"readable-stream": "~1.0.32"
|
||||
}
|
||||
},
|
||||
"busboy": {
|
||||
"version": "0.3.1",
|
||||
"resolved": "https://registry.npmjs.org/busboy/-/busboy-0.3.1.tgz",
|
||||
"integrity": "sha512-y7tTxhGKXcyBxRKAni+awqx8uqaJKrSFSNFSeRG5CsWNdmy2BIK+6VGWEW7TZnIO/533mtMEA4rOevQV815YJw==",
|
||||
"requires": {
|
||||
"dicer": "0.3.0"
|
||||
}
|
||||
},
|
||||
"bytebuffer": {
|
||||
"version": "5.0.1",
|
||||
"resolved": "https://registry.npmjs.org/bytebuffer/-/bytebuffer-5.0.1.tgz",
|
||||
@@ -816,8 +822,7 @@
|
||||
"concat-map": {
|
||||
"version": "0.0.1",
|
||||
"resolved": "https://registry.npmjs.org/concat-map/-/concat-map-0.0.1.tgz",
|
||||
"integrity": "sha1-2Klr13/Wjfd5OnMDajug1UBdR3s=",
|
||||
"dev": true
|
||||
"integrity": "sha1-2Klr13/Wjfd5OnMDajug1UBdR3s="
|
||||
},
|
||||
"concat-stream": {
|
||||
"version": "2.0.0",
|
||||
@@ -1903,13 +1908,6 @@
|
||||
"version": "1.0.0",
|
||||
"bundled": true
|
||||
},
|
||||
"minimatch": {
|
||||
"version": "3.0.4",
|
||||
"bundled": true,
|
||||
"requires": {
|
||||
"brace-expansion": "^1.1.7"
|
||||
}
|
||||
},
|
||||
"minimist": {
|
||||
"version": "1.2.0",
|
||||
"bundled": true
|
||||
@@ -2726,10 +2724,9 @@
|
||||
"optional": true
|
||||
},
|
||||
"minimatch": {
|
||||
"version": "3.0.4",
|
||||
"resolved": "https://registry.npmjs.org/minimatch/-/minimatch-3.0.4.tgz",
|
||||
"integrity": "sha512-yJHVQEhyqPLUTgt9B83PXu6W3rx4MvvHvSUvToogpwoGDOUQ+yDrR0HRot+yOCdCO7u4hX3pWft6kWBBcqh0UA==",
|
||||
"dev": true,
|
||||
"version": "3.1.2",
|
||||
"resolved": "https://registry.npmjs.org/minimatch/-/minimatch-3.1.2.tgz",
|
||||
"integrity": "sha512-J7p63hRiAjw1NDEww1W7i37+ByIrOWO5XQQAzZ3VOcL0PNybwpfmV/N05zFAzwQ9USyEcX6t3UO+K5aqBQOIHw==",
|
||||
"requires": {
|
||||
"brace-expansion": "^1.1.7"
|
||||
}
|
||||
|
||||
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 |
@@ -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>
|
||||
|
||||