From db4adf16520dfdeae250780b14cc14f3900dba70 Mon Sep 17 00:00:00 2001 From: Akshay Date: Sun, 3 Nov 2024 18:03:41 +0000 Subject: 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 --- src/routes/index.js | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'src/routes/index.js') 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) => { router.get('/r/:subreddit', async (req, res) => { var subreddit = req.params.subreddit; var query = req.query? req.query : {}; - var sort = query.sort? query.sort : 'hot'; + if (!query.sort) { + query.sort = 'hot'; + } - var postsReq = G.getSubmissions(sort, `${subreddit}`, query); + var postsReq = G.getSubmissions(query.sort, `${subreddit}`, query); var aboutReq = G.getSubreddit(`${subreddit}`); var [posts, about] = await Promise.all([postsReq, aboutReq]); -- cgit v1.2.3