added function to delete topic

This commit is contained in:
Leon Liang
2019-10-25 23:04:09 -04:00
parent b255006f7a
commit d9f6fb5d8e
2 changed files with 30 additions and 6 deletions

View File

@@ -55,7 +55,10 @@ app.post("/putPost", fbAuth, putPost);
/*------------------------------------------------------------------*
* handlers/topic.js *
*------------------------------------------------------------------*/
const { putTopic, getAllTopics
const {
putTopic,
getAllTopics,
deleteTopic
} = require("./handlers/topic");
// add topic to database
@@ -64,4 +67,7 @@ app.post("/putTopic", fbAuth, putTopic);
// get all topics from database
app.get("/getAllTopics", fbAuth, getAllTopics);
// delete a specific topic
app.delete("/deleteTopic/:topicId", fbAuth, deleteTopic);
exports.api = functions.https.onRequest(app);