diff options
author | Akshay <[email protected]> | 2024-11-13 22:46:26 +0000 |
---|---|---|
committer | Akshay <[email protected]> | 2024-11-13 22:46:26 +0000 |
commit | f039f2d55119fcad9964ae8b904e184c4c7e1191 (patch) | |
tree | 1e99de98163951c3cc8f60eb307d622f71ff90a3 /src/routes/index.js | |
parent | 2a4160145bdfc90d0ccd21970857b5aa63f592cd (diff) |
fix home
Diffstat (limited to 'src/routes/index.js')
-rw-r--r-- | src/routes/index.js | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/src/routes/index.js b/src/routes/index.js index 8e9c876..bb030b3 100644 --- a/src/routes/index.js +++ b/src/routes/index.js | |||
@@ -12,7 +12,12 @@ const G = new geddit.Geddit(); | |||
12 | 12 | ||
13 | // GET / | 13 | // GET / |
14 | router.get("/", authenticateToken, async (req, res) => { | 14 | router.get("/", authenticateToken, async (req, res) => { |
15 | res.render("home"); | 15 | const subs = db |
16 | .query("SELECT * FROM subscriptions WHERE user_id = $id") | ||
17 | .all({ id: req.user.id }); | ||
18 | const p = subs.map((s) => s.subreddit).join("+"); | ||
19 | console.log(p); | ||
20 | res.redirect(`/r/${p}`); | ||
16 | }); | 21 | }); |
17 | 22 | ||
18 | // GET /r/:id | 23 | // GET /r/:id |