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