Ghost/ghost/admin/app/models/tier.js
Rishabh ce80d250bf Handled null trial days on tiers
refs e26c977c66

- handles null trial days in admin and API, sets trial days as 0 for null values
2022-08-09 14:14:22 +05:30

20 lines
637 B
JavaScript

import Model, {attr} from '@ember-data/model';
import ValidationEngine from 'ghost-admin/mixins/validation-engine';
export default Model.extend(ValidationEngine, {
validationType: 'tier',
name: attr('string'),
description: attr('string'),
active: attr('boolean'),
slug: attr('string'),
welcomePageURL: attr('string'),
visibility: attr('string', {defaultValue: 'none'}),
type: attr('string', {defaultValue: 'paid'}),
currency: attr('string'),
monthlyPrice: attr('number'),
yearlyPrice: attr('number'),
trialDays: attr('number', {defaultValue: 0}),
benefits: attr('tier-benefits')
});