Merge branch 'master' into bootstrap3

This commit is contained in:
psychobunny
2013-08-27 06:03:05 +08:00
20 changed files with 340 additions and 158 deletions

View File

@@ -102,9 +102,12 @@ var user = require('./../user.js'),
res.json(data);
});
app.get('/api/topic/:id/:slug?', function(req, res) {
app.get('/api/topic/:id/:slug?', function(req, res, next) {
var uid = (req.user) ? req.user.uid : 0;
topics.getTopicWithPosts(req.params.id, uid, function(err, data) {
if(data.deleted === '1' && data.expose_tools === 0) {
return res.json(404, {});
}
res.json(data);
});
});