Skip to content

Commit

Permalink
Merge pull request #181 from SquareTable/166-tempthreadpostcomment-sh…
Browse files Browse the repository at this point in the history
…ould-return-newly-made-comment

temp/threadpostcomment now returns newly made comment
  • Loading branch information
Sebastian-Webster authored Oct 10, 2023
2 parents 9c21f22 + 238f455 commit 6b0a1ae
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion controllers/Temp.js
Original file line number Diff line number Diff line change
Expand Up @@ -3513,7 +3513,9 @@ class TempController {
var commentForPost = {commentId: objectId, commenterId: userId, commentsText: comment, commentUpVotes: [], commentDownVotes: [], commentReplies: [], datePosted: Date.now()}
Thread.findOneAndUpdate({_id: {$eq: postId}}, { $push: { comments: commentForPost } }).then(function(){
console.log("SUCCESS1")
return resolve(HTTPWTHandler.OK('Comment upload successful'))
commentForPost.commentId = String(commentForPost.commentId)
commentForPost.commenterId = String(commentForPost.commenterId)
return resolve(HTTPWTHandler.OK('Comment upload successful', commentForPost))
})
.catch(err => {
console.error('An error occurred while adding comment object:', commentForPost, "to thread's comments with id:", postId, '. The error was:', err)
Expand Down

0 comments on commit 6b0a1ae

Please sign in to comment.