From f8055775f3ac74e9e6054aef102673cefcf27986 Mon Sep 17 00:00:00 2001 From: Jules Laplace Date: Thu, 25 Jan 2018 02:15:48 +0100 Subject: more on profile --- bucky/app/api.js | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) (limited to 'bucky/app/api.js') diff --git a/bucky/app/api.js b/bucky/app/api.js index 7a0e068..80cba16 100644 --- a/bucky/app/api.js +++ b/bucky/app/api.js @@ -32,6 +32,23 @@ function route (app){ function(req, res){ res.json(util.sanitizeUser(res.user)) }) + app.get("/api/profile/:username", + middleware.ensureAuthenticated, + bucky.ensureUser, + bucky.sanitizeUser, + bucky.ensureThreadsForUser, + // bucky.ensureTopThreadsForUser, + // bucky.ensureCommentsForUser, + bucky.ensureFilesForUser, + function(req, res) { + res.json({ + user: res.user, + threads: res.threads, + // topThreads: res.topThreads, + files: res.files, + // comments: res.comments, + }) + }) app.put("/api/checkUsernames", middleware.ensureAuthenticated, bucky.checkUsernames, -- cgit v1.2.3-70-g09d2