mirror of
https://github.com/TryGhost/Ghost.git
synced 2024-12-19 08:31:43 +03:00
cc4ff8c6d4
refs https://github.com/TryGhost/Team/issues/3168 - This is basic scaffolding for collection resources UI in Admin. For the most part it's a copy-paste of tags code with slight modifications to fit the collections usecase
19 lines
427 B
JavaScript
19 lines
427 B
JavaScript
import BaseValidator from './base';
|
|
import {isBlank} from '@ember/utils';
|
|
|
|
export default BaseValidator.create({
|
|
properties: ['title'],
|
|
|
|
name(model) {
|
|
let title = model.title;
|
|
let hasValidated = model.hasValidated;
|
|
|
|
if (isBlank(title)) {
|
|
model.errors.add('title', 'Please enter a title.');
|
|
this.invalidate();
|
|
}
|
|
|
|
hasValidated.addObject('title');
|
|
}
|
|
});
|