From 08c0a7fa5e65a399d3c8ddd194be393a3ee8f974 Mon Sep 17 00:00:00 2001 From: psychobunny Date: Thu, 27 Feb 2014 16:38:10 -0500 Subject: [PATCH] removing old unread and recent routes --- src/routes/api.js | 39 --------------------------------------- src/webserver.js | 29 ----------------------------- 2 files changed, 68 deletions(-) diff --git a/src/routes/api.js b/src/routes/api.js index 0249b1c9f9..a5c9cab360 100644 --- a/src/routes/api.js +++ b/src/routes/api.js @@ -242,45 +242,6 @@ var path = require('path'), }); }); - app.get('/recent/:term?', function (req, res, next) { - var uid = (req.user) ? req.user.uid : 0; - topics.getLatestTopics(uid, 0, 19, req.params.term, function (err, data) { - if(err) { - return next(err); - } - - res.json(data); - }); - }); - - app.get('/unread', function (req, res, next) { - var uid = (req.user) ? req.user.uid : 0; - if(!req.user) { - return res.json(403, 'not-allowed'); - } - topics.getUnreadTopics(uid, 0, 19, function (err, data) { - if(err) { - return next(err); - } - - res.json(data); - }); - }); - - app.get('/unread/total', function (req, res, next) { - var uid = (req.user) ? req.user.uid : 0; - if(!req.user) { - return res.json(403, 'not-allowed'); - } - topics.getTotalUnread(uid, function (err, data) { - if(err) { - return next(err); - } - - res.json(data); - }); - }); - app.get('/notifications', function(req, res) { if (req.user && req.user.uid) { user.notifications.getAll(req.user.uid, null, null, function(err, notifications) { diff --git a/src/webserver.js b/src/webserver.js index 4fa1d27721..d00e11ec0c 100644 --- a/src/webserver.js +++ b/src/webserver.js @@ -632,35 +632,6 @@ process.on('uncaughtException', function(err) { app.get('/unread/:term?', app.buildHeader, app.authenticate, controllers.categories.unread); app.get('/api/unread/:term?', app.prepareAPI, app.authenticate, controllers.categories.unread); - /* - app.get('/unread', function (req, res, next) { - var uid = (req.user) ? req.user.uid : 0; - if(!req.user) { - return res.json(403, 'not-allowed'); - } - topics.getUnreadTopics(uid, 0, 19, function (err, data) { - if(err) { - return next(err); - } - - res.json(data); - }); - }); - - app.get('/unread/total', function (req, res, next) { - var uid = (req.user) ? req.user.uid : 0; - if(!req.user) { - return res.json(403, 'not-allowed'); - } - topics.getTotalUnread(uid, function (err, data) { - if(err) { - return next(err); - } - - res.json(data); - }); - });*/ - app.get('/category/:category_id/:slug?', app.buildHeader, controllers.categories.get); app.get('/api/category/:category_id/:slug?', app.prepareAPI, controllers.categories.get);