2014-07-25 23:17:16 +04:00
|
|
|
import NewUserValidator from 'ghost/validators/new-user';
|
|
|
|
|
2015-08-19 14:55:40 +03:00
|
|
|
export default NewUserValidator.create({
|
2015-06-07 06:19:19 +03:00
|
|
|
properties: ['name', 'email', 'password', 'blogTitle'],
|
2014-06-25 16:12:48 +04:00
|
|
|
|
2015-10-28 14:36:45 +03:00
|
|
|
blogTitle(model) {
|
|
|
|
let blogTitle = model.get('blogTitle');
|
2014-06-30 07:43:25 +04:00
|
|
|
|
2015-06-07 06:19:19 +03:00
|
|
|
if (!validator.isLength(blogTitle, 1)) {
|
|
|
|
model.get('errors').add('blogTitle', 'Please enter a blog title.');
|
|
|
|
this.invalidate();
|
|
|
|
}
|
2014-06-25 16:12:48 +04:00
|
|
|
}
|
2015-06-07 06:19:19 +03:00
|
|
|
});
|