mirror of
https://github.com/ClaytonWWilson/CS307-Team24.git
synced 2026-03-10 21:25:04 +00:00
Compare commits
9 Commits
lastfix
...
edc0519a1c
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
edc0519a1c | ||
|
|
2d8ae3e301 | ||
|
|
b9cbd610a9 | ||
| daabbf80f6 | |||
| f9acefaafb | |||
| 948eff32c2 | |||
| 6de219505a | |||
| 7132a2ab45 | |||
| 5474543af4 |
@@ -1,2 +1,2 @@
|
|||||||
# CS307-Team24
|
# CS307-Team24
|
||||||
CS307 Team 24 Twistter website.
|
CS307 Team 24 Twistter website
|
||||||
|
|||||||
@@ -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()
|
||||||
|
|||||||
@@ -1,5 +1,6 @@
|
|||||||
/* eslint-disable promise/catch-or-return */
|
/* eslint-disable promise/catch-or-return */
|
||||||
/* eslint-disable promise/always-return */
|
/* eslint-disable promise/always-return */
|
||||||
|
/* eslint-disable prefer-promise-reject-error */
|
||||||
|
|
||||||
const { admin, db } = require("../util/admin");
|
const { admin, db } = require("../util/admin");
|
||||||
const config = require("../util/config");
|
const config = require("../util/config");
|
||||||
@@ -866,10 +867,10 @@ oneWayCheck = (userA, userB) => {
|
|||||||
if (dmRecipient === userB) {
|
if (dmRecipient === userB) {
|
||||||
console.log(`You already have a DM with ${userB}`);
|
console.log(`You already have a DM with ${userB}`);
|
||||||
// reject(new Error(`You already have a DM with ${userB}`));
|
// reject(new Error(`You already have a DM with ${userB}`));
|
||||||
reject({
|
let e = new Error(`You already have a DM with that user`);
|
||||||
code: 400,
|
e.code = 400,
|
||||||
message: `You already have a DM with that user`
|
e.message = `You already have a DM with that user`
|
||||||
});
|
reject(e);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
@@ -1212,7 +1213,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) => {
|
||||||
|
|||||||
14
functions/package-lock.json
generated
14
functions/package-lock.json
generated
@@ -673,6 +673,14 @@
|
|||||||
"readable-stream": "~1.0.32"
|
"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": {
|
"bytebuffer": {
|
||||||
"version": "5.0.1",
|
"version": "5.0.1",
|
||||||
"resolved": "https://registry.npmjs.org/bytebuffer/-/bytebuffer-5.0.1.tgz",
|
"resolved": "https://registry.npmjs.org/bytebuffer/-/bytebuffer-5.0.1.tgz",
|
||||||
@@ -3707,9 +3715,9 @@
|
|||||||
"integrity": "sha512-LKYU1iAXJXUgAXn9URjiu+MWhyUXHsvfp7mcuYm9dSUKK0/CjtrUwFAxD82/mCWbtLsGjFIad0wIsod4zrTAEQ=="
|
"integrity": "sha512-LKYU1iAXJXUgAXn9URjiu+MWhyUXHsvfp7mcuYm9dSUKK0/CjtrUwFAxD82/mCWbtLsGjFIad0wIsod4zrTAEQ=="
|
||||||
},
|
},
|
||||||
"y18n": {
|
"y18n": {
|
||||||
"version": "3.2.1",
|
"version": "3.2.2",
|
||||||
"resolved": "https://registry.npmjs.org/y18n/-/y18n-3.2.1.tgz",
|
"resolved": "https://registry.npmjs.org/y18n/-/y18n-3.2.2.tgz",
|
||||||
"integrity": "sha1-bRX7qITAhnnA136I53WegR4H+kE="
|
"integrity": "sha512-uGZHXkHnhF0XeeAPgnKfPv1bgKAYyVvmNL1xlKsPYZPaIHxGti2hHqvOCQv71XMsLxu1QjergkqogUnms5D3YQ=="
|
||||||
},
|
},
|
||||||
"yallist": {
|
"yallist": {
|
||||||
"version": "3.0.3",
|
"version": "3.0.3",
|
||||||
|
|||||||
@@ -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>
|
||||||
|
|||||||
Reference in New Issue
Block a user