mirror of
https://github.com/ClaytonWWilson/CS307-Team24.git
synced 2025-12-16 02:08:47 +00:00
changed putPost function to see postID
This commit is contained in:
parent
51fc965a90
commit
b45fc3640c
@ -18,10 +18,15 @@ exports.putPost = (req, res) => {
|
||||
|
||||
};
|
||||
|
||||
const resPost;
|
||||
|
||||
admin.firestore().collection('posts').add(newPost)
|
||||
.then((doc) => {
|
||||
const resPost = newPost;
|
||||
resPost = newPost;
|
||||
resPost.postId = doc.id;
|
||||
return admin.firestore().doc(`posts/${doc.id}`).set(resPost)
|
||||
})
|
||||
.then(() => {
|
||||
return res.status(200).json(resPost);
|
||||
})
|
||||
.catch((err) => {
|
||||
|
||||
Loading…
Reference in New Issue
Block a user