aboutsummaryrefslogtreecommitdiff
path: root/src/routes/index.js
diff options
context:
space:
mode:
Diffstat (limited to 'src/routes/index.js')
-rw-r--r--src/routes/index.js14
1 files changed, 14 insertions, 0 deletions
diff --git a/src/routes/index.js b/src/routes/index.js
index 7fe9e2a..77ddd78 100644
--- a/src/routes/index.js
+++ b/src/routes/index.js
@@ -38,6 +38,20 @@ router.get("/comments/:id", async (req, res) => {
38 res.render("comments", unescape_submission(response)); 38 res.render("comments", unescape_submission(response));
39}); 39});
40 40
41// GET /comments/:parent_id/comment/:child_id
42router.get("/comments/:parent_id/comment/:child_id", async (req, res) => {
43 const parent_id = req.params.parent_id;
44 const child_id = req.params.child_id;
45
46 const params = {
47 limit: 50,
48 };
49 response = await G.getSingleCommentThread(parent_id, child_id, params);
50 const comments = response.comments;
51 comments.forEach(unescape_comment);
52 res.render("single_comment_thread", { comments, parent_id });
53});
54
41// GET /subs 55// GET /subs
42router.get("/subs", async (req, res) => { 56router.get("/subs", async (req, res) => {
43 res.render("subs"); 57 res.render("subs");