mirror of
https://github.com/TryGhost/Ghost.git
synced 2024-11-29 07:09:48 +03:00
14 lines
355 B
JavaScript
14 lines
355 B
JavaScript
|
import BaseValidator from './base';
|
||
|
import {isBlank} from '@ember/utils';
|
||
|
|
||
|
export default BaseValidator.create({
|
||
|
properties: ['name'],
|
||
|
|
||
|
name(model) {
|
||
|
if (isBlank(model.name)) {
|
||
|
model.errors.add('name', 'Please enter a name');
|
||
|
model.hasValidated.pushObject('name');
|
||
|
this.invalidate();
|
||
|
}
|
||
|
}
|
||
|
});
|