Ghost/ghost/admin/app/models/product-benefit-item.js
Rishabh Garg 46b311b561 Wired benefits section to API (#2023)
refs https://github.com/TryGhost/Team/issues/792

- updates product benefit to use `name` instead of `label` attribute for benefit text
- updates model/serializer/validator to correctly handle benefit attributes
- added `+` button for adding new labels as the enter behavior is closing the popup(needs fix)
2021-06-28 15:19:54 +05:30

24 lines
547 B
JavaScript

import EmberObject from '@ember/object';
import ValidationEngine from 'ghost-admin/mixins/validation-engine';
import {computed} from '@ember/object';
import {isBlank} from '@ember/utils';
export default EmberObject.extend(ValidationEngine, {
name: '',
isNew: false,
validationType: 'productBenefitItem',
isComplete: computed('name', function () {
let {name} = this;
return !isBlank(name);
}),
isBlank: computed('name', function () {
let {name} = this;
return isBlank(name);
})
});