Added function to follow and unfollow users

This commit is contained in:
Leon Liang
2019-11-15 17:47:47 -05:00
parent 903ea35662
commit 1d26eb97ad
2 changed files with 137 additions and 51 deletions

View File

@@ -19,7 +19,10 @@ const {
updateProfileInfo,
verifyUser,
unverifyUser,
getUserHandles
getUserHandles,
addSubscription,
getSubs,
removeSub
} = require("./handlers/users");
// Adds a user to the database and registers them in firebase with
@@ -55,6 +58,15 @@ app.post("/unverifyUser", fbAuth, unverifyUser);
// get user handles with search phase
app.get("/getUserHandles", fbAuth, getUserHandles);
// get user's subscription
app.get("/getSubs", fbAuth, getSubs);
// add user to another user's "following" data field
app.post("/addSubscription", fbAuth, addSubscription);
// remove one subscription
app.delete("/removeSub", fbAuth, removeSub);
/*------------------------------------------------------------------*
* handlers/post.js *
*------------------------------------------------------------------*/