diff options
| author | pep <yes@peepee.me> | 2020-07-21 20:46:56 +0000 |
|---|---|---|
| committer | pep <yes@peepee.me> | 2020-07-21 20:46:56 +0000 |
| commit | 97bee7fe1a48acb4c34e207863af56894c198151 (patch) | |
| tree | 7a03bacd383319f2e4af70beb57ff0f9ae31b010 /bucky/app/api.js | |
| parent | d93c099733afff27fbf7c172a40eca87519d38b7 (diff) | |
| parent | 8a3178339ad407ec85ef0cd014a6ad13bfb4cadd (diff) | |
attempt at merge
Diffstat (limited to 'bucky/app/api.js')
| -rw-r--r-- | bucky/app/api.js | 25 |
1 files changed, 25 insertions, 0 deletions
diff --git a/bucky/app/api.js b/bucky/app/api.js index 75cdbd7..d2472c3 100644 --- a/bucky/app/api.js +++ b/bucky/app/api.js @@ -34,6 +34,19 @@ function route (app){ function(req, res){ res.json(util.sanitizeUser(res.user)) }) + app.get("/api/users", + middleware.ensureAuthenticated, + bucky.ensureUserlist, + bucky.ensureUserThreadCounts, + bucky.ensureUserFileCounts, + bucky.ensureUserCommentCounts, + bucky.ensureUserStatistics, + function(req, res) { + res.json({ + users: res.users, + userStats: res.userStats, + }) + }) app.get("/api/profile/:username", middleware.ensureAuthenticated, bucky.ensureUser, @@ -153,6 +166,16 @@ function route (app){ function(req, res){ res.send({ status: 'ok' }) }) + app.get("/api/thread/:id/bury", + middleware.ensureAuthenticated, + bucky.ensureThread, + privacy.checkThreadPrivacy, + bucky.buryThread, + function(req, res){ + res.json({ + thread: res.thread, + }) + }) /* comments */ @@ -259,9 +282,11 @@ function route (app){ middleware.ensureAuthenticated, bucky.ensureKeywords, bucky.ensureThreadGroups, + bucky.ensureLatestKeywordThreads, function(req, res){ res.json({ keywords: res.keywords, + threads: res.threads, threadGroups: res.threadGroups, }) }) |
