Ghost/ghost/admin/app/validators/collection.js
Naz cc4ff8c6d4 Added collections CRUD UI
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
2023-05-23 17:26:47 +07:00

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');
}
});