fixed up add subscription method

This commit is contained in:
Leon Liang
2019-12-05 19:24:50 -05:00
parent c7859e0f0a
commit f111553827
3 changed files with 86 additions and 66 deletions

View File

@@ -1145,8 +1145,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