|
|
@ -9,7 +9,10 @@ var async = require('async'),
|
|
|
|
module.exports = function(Topics) {
|
|
|
|
module.exports = function(Topics) {
|
|
|
|
|
|
|
|
|
|
|
|
Topics.createTags = function(tags, tid, timestamp, callback) {
|
|
|
|
Topics.createTags = function(tags, tid, timestamp, callback) {
|
|
|
|
if(Array.isArray(tags)) {
|
|
|
|
if (!Array.isArray(tags) || !tags.length) {
|
|
|
|
|
|
|
|
return callback();
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
tags = tags.slice(0, meta.config.tagsPerTopic || 5);
|
|
|
|
tags = tags.slice(0, meta.config.tagsPerTopic || 5);
|
|
|
|
|
|
|
|
|
|
|
|
async.each(tags, function(tag, next) {
|
|
|
|
async.each(tags, function(tag, next) {
|
|
|
@ -27,7 +30,6 @@ module.exports = function(Topics) {
|
|
|
|
next(err);
|
|
|
|
next(err);
|
|
|
|
});
|
|
|
|
});
|
|
|
|
}, callback);
|
|
|
|
}, callback);
|
|
|
|
}
|
|
|
|
|
|
|
|
};
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
function cleanUpTag(tag) {
|
|
|
|
function cleanUpTag(tag) {
|
|
|
|