v1.18.x
Julian Lam 12 years ago
parent d1c756306a
commit f6b865a052

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

Loading…
Cancel
Save