mirror of
https://github.com/TryGhost/Ghost.git
synced 2024-12-19 16:42:17 +03:00
18 lines
393 B
JavaScript
18 lines
393 B
JavaScript
|
var PostValidator = Ember.Object.create({
|
||
|
validate: function (model) {
|
||
|
var validationErrors = [],
|
||
|
|
||
|
title = model.get('title');
|
||
|
|
||
|
if (validator.empty(title)) {
|
||
|
validationErrors.push({
|
||
|
message: 'You must specify a title for the post.'
|
||
|
});
|
||
|
}
|
||
|
|
||
|
return validationErrors;
|
||
|
}
|
||
|
});
|
||
|
|
||
|
export default PostValidator;
|