summaryrefslogtreecommitdiff
path: root/bucky/app/router.js
diff options
context:
space:
mode:
authorJules Laplace <jules@okfoc.us>2015-09-25 18:05:37 -0400
committerJules Laplace <jules@okfoc.us>2015-09-25 18:05:37 -0400
commited083ad3191a5d7d61abb21fa7dafec5121ecaab (patch)
tree46f73a62a8c8115d900221ae1b9fca7d4e662030 /bucky/app/router.js
parent3aa171fbaf05d0ee5b82673443da51ed43719475 (diff)
post comment
Diffstat (limited to 'bucky/app/router.js')
-rw-r--r--bucky/app/router.js8
1 files changed, 7 insertions, 1 deletions
diff --git a/bucky/app/router.js b/bucky/app/router.js
index 7ac6599..fe7d336 100644
--- a/bucky/app/router.js
+++ b/bucky/app/router.js
@@ -66,8 +66,14 @@ module.exports = function(app){
})
app.post("/api/thread/:id/comment",
middleware.ensureAuthenticated,
+ bucky.ensureThread,
+ // ensure thread privacy
+ bucky.createComment,
+ // add comments and files
function(req, res){
- // add comments and files
+ res.json({
+ comment: res.comment
+ })
})
app.delete("/api/thread/:id",
middleware.ensureAuthenticated,