Commit 984c1551 authored by Rene Saarsoo's avatar Rene Saarsoo
Browse files

Implement request for retrieving individual comment content.

Allows first phase in comment editing - popping up the editor.
parent 59dc2abf
Loading
Loading
Loading
Loading
+7 −0
Original line number Diff line number Diff line
@@ -121,6 +121,13 @@ app.get('/auth/:sdk/:version/comments', services.comments, function(req, res) {
    });
});

// Returns plain markdown content of individual comment (used when editing a comment)
app.get('/auth/:sdk/:version/comments/:commentId', services.comments, function(req, res) {
    req.comments.getById(req.params.commentId, function(err, comment) {
        res.json({ success: true, content: comment.content });
    });
});

// Adds new comment
app.post('/auth/:sdk/:version/comments', services.requireLogin, services.comments, function(req, res) {
    var comment = {