2014-07-25 23:17:16 +04:00
|
|
|
import NewUserValidator from 'ghost/validators/new-user';
|
|
|
|
|
|
|
|
var SetupValidator = NewUserValidator.extend({
|
2014-06-30 07:43:25 +04:00
|
|
|
check: function (model) {
|
2014-07-25 23:17:16 +04:00
|
|
|
var data = model.getProperties('blogTitle'),
|
|
|
|
validationErrors = this._super(model);
|
2014-06-25 16:12:48 +04:00
|
|
|
|
2014-07-15 23:52:44 +04:00
|
|
|
if (!validator.isLength(data.blogTitle, 1)) {
|
2014-06-25 16:12:48 +04:00
|
|
|
validationErrors.push({
|
|
|
|
message: 'Please enter a blog title.'
|
|
|
|
});
|
|
|
|
}
|
2014-06-30 07:43:25 +04:00
|
|
|
|
2014-06-25 16:12:48 +04:00
|
|
|
return validationErrors;
|
|
|
|
}
|
2014-07-25 23:17:16 +04:00
|
|
|
}).create();
|
2014-06-25 16:12:48 +04:00
|
|
|
|
|
|
|
export default SetupValidator;
|