|
|
@ -276,6 +276,17 @@ var path = require('path'),
|
|
|
|
});
|
|
|
|
});
|
|
|
|
});
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
app.get('/recent/posts/:term?', function (req, res, next) {
|
|
|
|
|
|
|
|
var uid = (req.user) ? req.user.uid : 0;
|
|
|
|
|
|
|
|
posts.getRecentPosts(uid, 0, 19, req.params.term, function (err, data) {
|
|
|
|
|
|
|
|
if(err) {
|
|
|
|
|
|
|
|
return next(err);
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
res.json(data);
|
|
|
|
|
|
|
|
});
|
|
|
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
|
|
app.get('/recent/:term?', function (req, res, next) {
|
|
|
|
app.get('/recent/:term?', function (req, res, next) {
|
|
|
|
var uid = (req.user) ? req.user.uid : 0;
|
|
|
|
var uid = (req.user) ? req.user.uid : 0;
|
|
|
|
topics.getLatestTopics(uid, 0, 19, req.params.term, function (err, data) {
|
|
|
|
topics.getLatestTopics(uid, 0, 19, req.params.term, function (err, data) {
|
|
|
|