mirror of
https://github.com/TryGhost/Ghost.git
synced 2024-12-28 21:33:24 +03:00
2555b70456
refs TryGhost/Team#627 This updates the new Products settings screens to use real data from API for existing Custom Products and Prices to populate them on UI and allow site owners to edit them. - List all Products of site and allow editing Product name - List all Prices for a product and allow editing individual Price names - Add new Prices on a Product
14 lines
351 B
JavaScript
14 lines
351 B
JavaScript
import BaseValidator from './base';
|
|
import validator from 'validator';
|
|
|
|
export default BaseValidator.create({
|
|
properties: ['name'],
|
|
|
|
name(model) {
|
|
if (!validator.isLength(model.name || '', 0, 191)) {
|
|
model.errors.add('name', 'Name cannot be longer than 191 characters.');
|
|
this.invalidate();
|
|
}
|
|
}
|
|
});
|