mirror of
https://github.com/NodeBB/NodeBB.git
synced 2025-11-10 07:55:46 +01:00
refactor to remove category_name and category_slug from topic hashes
This commit is contained in:
@@ -41,25 +41,12 @@ var RDB = require('./../redis.js'),
|
||||
var slug = cid + '/' + utils.slugify(category[key]);
|
||||
RDB.hset('category:' + cid, 'slug', slug);
|
||||
RDB.set('categoryslug:' + slug + ':cid', cid);
|
||||
|
||||
RDB.smembers('categories:' + cid + ':tid', function(err, tids) {
|
||||
var pipe = RDB.multi();
|
||||
|
||||
for (var tid in tids) {
|
||||
pipe.set(schema.topics(tid).category_name, category[key]);
|
||||
pipe.set(schema.topics(tid).category_slug, slug);
|
||||
}
|
||||
pipe.exec();
|
||||
});
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
updated.push(cid);
|
||||
}
|
||||
|
||||
|
||||
|
||||
socket.emit('event:alert', {
|
||||
title: 'Updated Categories',
|
||||
message: 'Category IDs ' + updated.join(', ') + ' was successfully updated.',
|
||||
|
||||
Reference in New Issue
Block a user