Merge branch 'master' into dms

This commit is contained in:
2019-12-02 16:21:26 -05:00
committed by GitHub
11 changed files with 1168 additions and 308 deletions

View File

@@ -24,7 +24,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
@@ -56,6 +59,8 @@ app.post("/dms/toggle", fbAuth, toggleDirectMessages);
app.get("/getUser", fbAuth, getUserDetails);
app.post("/getUserDetails", fbAuth, getUserDetails);
// Returns all profile data of the currently logged in user
app.get("/getProfileInfo", fbAuth, getProfileInfo);
@@ -74,13 +79,22 @@ app.post("/verifyUser", fbAuth, verifyUser);
app.post("/unverifyUser", fbAuth, unverifyUser);
// get user handles with search phase
app.get("/getUserHandles", fbAuth, getUserHandles);
app.post("/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.post("/removeSub", fbAuth, removeSub);
/*------------------------------------------------------------------*
* handlers/post.js *
*------------------------------------------------------------------*/
const { getallPostsforUser, getallPosts, putPost } = require("./handlers/post");
const { getallPostsforUser, getallPosts, putPost, likePost, unlikePost, quoteWithPost, quoteWithoutPost, checkforLikePost} = require("./handlers/post");
app.get("/getallPostsforUser", fbAuth, getallPostsforUser);
@@ -89,11 +103,23 @@ app.get("/getallPosts", getallPosts);
// Adds one post to the database
app.post("/putPost", fbAuth, putPost);
app.get("/like/:postId", fbAuth, likePost);
app.get("/unlike/:postId", fbAuth, unlikePost);
app.get("/checkforLikePost/:postId", fbAuth, checkforLikePost);
app.post("/quoteWithPost/:postId", fbAuth, quoteWithPost);
app.post("/quoteWithoutPost/:postId", fbAuth, quoteWithoutPost);
/*------------------------------------------------------------------*
* handlers/topic.js *
*------------------------------------------------------------------*/
const { putTopic, getAllTopics, deleteTopic } = require("./handlers/topic");
const {
putTopic,
getAllTopics,
deleteTopic,
getUserTopics
} = require("./handlers/topic");
// add topic to database
app.post("/putTopic", fbAuth, putTopic);
@@ -102,6 +128,9 @@ app.post("/putTopic", fbAuth, putTopic);
app.get("/getAllTopics", fbAuth, getAllTopics);
// delete a specific topic
app.delete("/deleteTopic/:topicId", fbAuth, deleteTopic);
app.post("/deleteTopic", fbAuth, deleteTopic);
// get topic for this user
app.post("/getUserTopics", fbAuth, getUserTopics);
exports.api = functions.https.onRequest(app);