Merge pull request #111 from ClaytonWWilson/filter_timeli

fixed up add subscription method
This commit is contained in:
Leon Liang
2019-12-05 19:25:44 -05:00
committed by GitHub
3 changed files with 85 additions and 65 deletions

View File

@@ -1178,8 +1178,12 @@ exports.addSubscription = (req, res) => {
let userRef = db.doc(`/users/${req.userData.handle}`);
userRef.get().then(doc => {
new_following = doc.data().following;
const struct = {
handle: req.body.following,
topics: ["Admin"]
}
new_following
? new_following.push(req.body.following)
? new_following.push(struct)
: (new_following = req.body.following);
// add stuff