mirror of
https://github.com/ClaytonWWilson/CS307-Team24.git
synced 2025-12-16 02:08:47 +00:00
Add post id
This commit is contained in:
parent
d6876eab0b
commit
b01aa92f96
@ -17,6 +17,7 @@ exports.putPost = (req, res) => {
|
|||||||
|
|
||||||
admin.firestore().collection('posts').add(newPost)
|
admin.firestore().collection('posts').add(newPost)
|
||||||
.then((doc) => {
|
.then((doc) => {
|
||||||
|
doc.update({postId: doc.id})
|
||||||
const resPost = newPost;
|
const resPost = newPost;
|
||||||
resPost.postId = doc.id;
|
resPost.postId = doc.id;
|
||||||
return res.status(200).json(resPost);
|
return res.status(200).json(resPost);
|
||||||
@ -67,4 +68,4 @@ exports.getallPosts = (req, res) => {
|
|||||||
|
|
||||||
exports.getFilteredPosts = (req, res) => {
|
exports.getFilteredPosts = (req, res) => {
|
||||||
admin.firestore().collection('posts').where('userHandle', '==', 'new user').where('microBlogTopics', '==')
|
admin.firestore().collection('posts').where('userHandle', '==', 'new user').where('microBlogTopics', '==')
|
||||||
};
|
};
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user