aboutsummaryrefslogtreecommitdiff
path: root/src/routes/index.js
diff options
context:
space:
mode:
authorAkshay <[email protected]>2024-10-31 14:41:31 +0000
committerAkshay <[email protected]>2024-10-31 14:41:31 +0000
commit5de14f99c9e9b0d20e8768b1373e172af595c648 (patch)
tree524752e17b807ce227d31810b082fcd738a1994f /src/routes/index.js
parent9914e4bf6856c0c76e6ee1371f708be946797ad5 (diff)
improve mobile ui, add pagination
Diffstat (limited to 'src/routes/index.js')
-rw-r--r--src/routes/index.js3
1 files changed, 2 insertions, 1 deletions
diff --git a/src/routes/index.js b/src/routes/index.js
index 867a223..5f43764 100644
--- a/src/routes/index.js
+++ b/src/routes/index.js
@@ -17,11 +17,12 @@ router.get('/r/:subreddit/:sort?', async (req, res) => {
17 var sort = req.params.sort ? req.params.sort : 'hot'; 17 var sort = req.params.sort ? req.params.sort : 'hot';
18 var options = req.query; 18 var options = req.query;
19 19
20 // var postsReq = G.getSubmissions(sort, `r/${subreddit}`, options);
21 var postsReq = G.getSubmissions(sort, `${subreddit}`, options); 20 var postsReq = G.getSubmissions(sort, `${subreddit}`, options);
22 var aboutReq = G.getSubreddit(`${subreddit}`); 21 var aboutReq = G.getSubreddit(`${subreddit}`);
23 22
24 var [posts, about] = await Promise.all([postsReq, aboutReq]); 23 var [posts, about] = await Promise.all([postsReq, aboutReq]);
24 console.log(`posts for ${subreddit}`);
25 console.log(posts.posts.length);
25 26
26 res.render('index', { subreddit, posts, about }); 27 res.render('index', { subreddit, posts, about });
27}); 28});