|
|
|
@ -96,6 +96,9 @@ module.exports = function(Topics) {
|
|
|
|
|
function(next) {
|
|
|
|
|
checkTitleLength(title, next);
|
|
|
|
|
},
|
|
|
|
|
function(next) {
|
|
|
|
|
checkTagsLength(data.tags, next);
|
|
|
|
|
},
|
|
|
|
|
function(next) {
|
|
|
|
|
checkContentLength(data.content, next);
|
|
|
|
|
},
|
|
|
|
@ -290,6 +293,13 @@ module.exports = function(Topics) {
|
|
|
|
|
callback();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
function checkTagsLength(tags, callback) {
|
|
|
|
|
if (!tags || tags.length < parseInt(meta.config.minimumTagsPerTopic, 10)) {
|
|
|
|
|
return callback(new Error('[[error:not-enough-tags, ' + meta.config.minimumTagsPerTopic + ']]'));
|
|
|
|
|
}
|
|
|
|
|
callback();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
function checkContentLength(content, callback) {
|
|
|
|
|
if (!content || content.length < parseInt(meta.config.miminumPostLength, 10)) {
|
|
|
|
|
return callback(new Error('[[error:content-too-short, ' + meta.config.minimumPostLength + ']]'));
|
|
|
|
|