v1.18.x
barisusakli 11 years ago
parent efcc42f170
commit 5ec289eee2

@ -13,14 +13,16 @@ tagsController.getTag = function(req, res, next) {
return next(err); return next(err);
} }
if (!tids || !tids.length) {
topics.deleteTag(tag);
return res.render('tag', {topics: [], tag:tag});
}
topics.getTopics('tag:' + tag + ':topics', uid, tids, function(err, data) { topics.getTopics('tag:' + tag + ':topics', uid, tids, function(err, data) {
if (err) { if (err) {
return next(err); return next(err);
} }
data.tag = tag; data.tag = tag;
if (data.topics && !data.topics.length) {
topics.deleteTag(tag);
}
res.render('tag', data); res.render('tag', data);
}); });
}); });

Loading…
Cancel
Save