diff options
| author | Jules Laplace <julescarbon@gmail.com> | 2017-12-15 05:36:50 +0100 |
|---|---|---|
| committer | Jules Laplace <julescarbon@gmail.com> | 2017-12-15 05:36:50 +0100 |
| commit | 7ad469291c015b33a2d20587db26b9621ed82d00 (patch) | |
| tree | 83e2a56822033a638d03ff7ddf4bfee3181631e6 /bucky/app/router.js | |
| parent | cc585396a85e3107bb7b4298098b84b738919c8f (diff) | |
sort file list by name or date, updates audio player
Diffstat (limited to 'bucky/app/router.js')
| -rw-r--r-- | bucky/app/router.js | 29 |
1 files changed, 12 insertions, 17 deletions
diff --git a/bucky/app/router.js b/bucky/app/router.js index 106c65e..e24253a 100644 --- a/bucky/app/router.js +++ b/bucky/app/router.js @@ -76,8 +76,7 @@ module.exports = function(app){ bucky.sanitizeUser, function(req, res) { res.json(res.user) - } - ) + }) app.post("/api/user/:username", middleware.ensureAuthenticated, bucky.ensureUser, @@ -90,6 +89,13 @@ module.exports = function(app){ function(req, res){ res.json(util.sanitizeUser(res.user)) }) + app.put("/api/checkUsernames", + middleware.ensureAuthenticated, + bucky.checkUsernames, + function(req, res){ + res.send({ usernames: res.usernames }) + }) + /* threads */ @@ -97,7 +103,7 @@ module.exports = function(app){ bucky.ensureLastlog, middleware.ensureAuthenticated, bucky.ensureLatestThreads, - bucky.ensureThreadsPrivacy, + bucky.filterPrivateThreads, bucky.ensureCommentCountsForThreads, bucky.ensureFileCountsForThreads, bucky.ensureKeywordsForThreads, @@ -114,7 +120,7 @@ module.exports = function(app){ bucky.ensureLastlog, middleware.ensureAuthenticated, bucky.ensureThreadsForKeyword, - bucky.ensureThreadsPrivacy, + bucky.filterPrivateThreads, bucky.ensureCommentCountsForThreads, bucky.ensureFileCountsForThreads, bucky.ensureKeywordsForThreads, @@ -127,22 +133,11 @@ module.exports = function(app){ lastlog: res.lastlog, }) }) - // app.get("/api/thread/:id/interested", - // middleware.ensureAuthenticated, - // bucky.ensureThread, - // bucky.ensureThreadPrivacy, - // bucky.ensureInterestedUsers, - // // bucky.ensureThreadUsers, - // function(req, res){ - // res.json({ - // interestedUsers: res.interestedUsers, - // }) - // }) app.get("/api/thread/:id", middleware.ensureAuthenticated, bucky.ensureThread, + bucky.checkThreadPrivacy, bucky.bumpViewCount, - bucky.ensureThreadPrivacy, bucky.ensureKeywordForThread, bucky.ensureCommentsForThread, bucky.ensureFilesForThread, @@ -152,7 +147,6 @@ module.exports = function(app){ function(req, res){ res.json({ thread: res.thread, - thread_users: res.thread, comments: res.comments, files: res.files, keyword: res.keyword, @@ -261,6 +255,7 @@ module.exports = function(app){ middleware.ensureAuthenticated, bucky.ensureKeyword, bucky.ensureThreadsForKeyword, + bucky.filterPrivateThreads, bucky.ensureCommentCountsForThreads, bucky.ensureFileCountsForThreads, bucky.ensureKeywordsForThreads, |
