aboutsummaryrefslogtreecommitdiff
path: root/src/routes/index.js
diff options
context:
space:
mode:
authorAkshay <[email protected]>2024-11-03 18:03:41 +0000
committerAkshay <[email protected]>2024-11-03 18:03:41 +0000
commitdb4adf16520dfdeae250780b14cc14f3900dba70 (patch)
tree39b3972beffb1bb1a2e618802f5259bf9937c297 /src/routes/index.js
parent13589cb7a024efaa51e9efbce5b4e8ad7475d448 (diff)
fix annoyingly oversized link
a > h1 results in big text, big link, h1 > a, results in big text, small link, and keeps people with fat thumbs happy
Diffstat (limited to 'src/routes/index.js')
-rw-r--r--src/routes/index.js6
1 files changed, 4 insertions, 2 deletions
diff --git a/src/routes/index.js b/src/routes/index.js
index f7a0425..54a5b18 100644
--- a/src/routes/index.js
+++ b/src/routes/index.js
@@ -14,9 +14,11 @@ router.get('/', async (req, res) => {
14router.get('/r/:subreddit', async (req, res) => { 14router.get('/r/:subreddit', async (req, res) => {
15 var subreddit = req.params.subreddit; 15 var subreddit = req.params.subreddit;
16 var query = req.query? req.query : {}; 16 var query = req.query? req.query : {};
17 var sort = query.sort? query.sort : 'hot'; 17 if (!query.sort) {
18 query.sort = 'hot';
19 }
18 20
19 var postsReq = G.getSubmissions(sort, `${subreddit}`, query); 21 var postsReq = G.getSubmissions(query.sort, `${subreddit}`, query);
20 var aboutReq = G.getSubreddit(`${subreddit}`); 22 var aboutReq = G.getSubreddit(`${subreddit}`);
21 23
22 var [posts, about] = await Promise.all([postsReq, aboutReq]); 24 var [posts, about] = await Promise.all([postsReq, aboutReq]);