Ghost/ghost/admin/app/models/product.js
Rishabh dc6b2884f1 Added model and validator for product's benefit item
refs https://github.com/TryGhost/Team/issues/792

- updates product model to read product's list of benefits
- adds transformer to return emberArray with list of product benefits
- adds new model for each product benefit
- adds validator for new product benefit
2021-06-21 14:05:01 +05:30

14 lines
404 B
JavaScript

import Model, {attr} from '@ember-data/model';
import ValidationEngine from 'ghost-admin/mixins/validation-engine';
export default Model.extend(ValidationEngine, {
validationType: 'product',
name: attr('string'),
description: attr('string'),
slug: attr('string'),
monthlyPrice: attr('stripe-price'),
yearlyPrice: attr('stripe-price'),
benefits: attr('product-benefits')
});