Revert "Updated usage of subscriptions data for members (#1834)"

This reverts commit fbd42ef33e.
This commit is contained in:
Rish 2021-02-04 11:56:26 +05:30
parent ce20117307
commit d539d4ca53
3 changed files with 8 additions and 6 deletions

View File

@ -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('_', ' ') : '';

View File

@ -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'),

View File

@ -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
};
}
});