fixed a bug that made topics invisible to users, also closes #47

This commit is contained in:
Baris Soner Usakli
2013-07-04 13:29:29 -04:00
parent 8dd7c5fdd1
commit ed99f2671e
4 changed files with 20 additions and 5 deletions

View File

@@ -167,6 +167,9 @@ var RDB = require('./redis.js'),
if (!err && result === 1) {
topics.setTopicField(tid, 'cid', cid);
categories.incrementCategoryFieldBy(oldCid, 'topic_count', -1);
categories.incrementCategoryFieldBy(cid, 'topic_count', 1);
categories.getCategories([cid], function(data) {
topics.setTopicField(tid, 'category_name', data.categories[0].name);