added entering topics field and database call for adding topics when writing microblog

This commit is contained in:
Aditya Sankaran
2019-10-01 19:07:57 -04:00
parent 311e8b3716
commit 9d4f175a49
4 changed files with 29 additions and 9 deletions

View File

@@ -11,6 +11,7 @@ exports.putPost = (req, res) => {
createdAt: new Date().toISOString(),
likeCount: 0,
commentCount: 0,
microBlogTopics: req.body.microBlogTopics
};

View File

@@ -253,7 +253,8 @@ const {putPost, getallPostsforUser} = require('./handlers/post');
app.get('/getallPostsforUser', getallPostsforUser);
// Adds one post to the database
app.post('/putPost', fbAuth, putPost);
app.post('/putPost', firebaseAuth, putPost);
exports.api = functions.https.onRequest(app);