Revert "Updated usage of subscriptions data for members (#1834)"
This reverts commit fbd42ef33e
.
This commit is contained in:
parent
ce20117307
commit
d539d4ca53
@ -20,7 +20,7 @@ export default Component.extend({
|
||||
// Allowed actions
|
||||
setProperty: () => {},
|
||||
|
||||
hasMultipleSubscriptions: gt('member.subscriptions', 1),
|
||||
hasMultipleSubscriptions: gt('member.stripe', 1),
|
||||
|
||||
canShowStripeInfo: computed('member.isNew', 'membersUtils.isStripeEnabled', function () {
|
||||
let stripeEnabled = this.membersUtils.isStripeEnabled;
|
||||
@ -32,8 +32,8 @@ export default Component.extend({
|
||||
}
|
||||
}),
|
||||
|
||||
subscriptions: computed('member.subscriptions', function () {
|
||||
let subscriptions = this.member.get('subscriptions');
|
||||
subscriptions: computed('member.stripe', function () {
|
||||
let subscriptions = this.member.get('stripe');
|
||||
if (subscriptions && subscriptions.length > 0) {
|
||||
return subscriptions.map((subscription) => {
|
||||
const statusLabel = subscription.status ? subscription.status.replace('_', ' ') : '';
|
||||
|
@ -10,7 +10,7 @@ export default Model.extend(ValidationEngine, {
|
||||
email: attr('string'),
|
||||
note: attr('string'),
|
||||
createdAtUTC: attr('moment-utc'),
|
||||
subscriptions: attr('member-subscription'),
|
||||
stripe: attr('member-subscription'),
|
||||
subscribed: attr('boolean', {defaultValue: true}),
|
||||
comped: attr('boolean', {defaultValue: false}),
|
||||
geolocation: attr('json-string'),
|
||||
|
@ -6,7 +6,7 @@ export default Transform.extend({
|
||||
deserialize(serialized) {
|
||||
let subscriptions, subscriptionArray;
|
||||
|
||||
subscriptionArray = serialized || [];
|
||||
subscriptionArray = serialized.subscriptions || [];
|
||||
|
||||
subscriptions = subscriptionArray.map(itemDetails => MemberSubscription.create(itemDetails));
|
||||
|
||||
@ -24,6 +24,8 @@ export default Transform.extend({
|
||||
subscriptionArray = [];
|
||||
}
|
||||
|
||||
return subscriptionArray;
|
||||
return {
|
||||
subscriptions: subscriptionArray
|
||||
};
|
||||
}
|
||||
});
|
||||
|
Loading…
Reference in New Issue
Block a user