🐛 Fixed error on saving a paid member (#2312)

refs https://github.com/TryGhost/Team/issues/1435
refs a47b61c1d4

A recent change for showing all subscriptions of a member on detail screen introduced a circular json structure with subscription -> tiers -> subscriptions, which throws an error on saving any member with paid subscription on member detail screen.
This commit is contained in:
Rishabh Garg 2022-03-22 21:58:21 +05:30 committed by Rishabh
parent 1832e7dc93
commit 7080505004
2 changed files with 8 additions and 6 deletions

View File

@ -79,15 +79,15 @@ export default class extends Component {
isComplimentary: !sub.id
};
});
for (let product of products) {
return products.map((product) => {
let productSubscriptions = subscriptionData.filter((subscription) => {
return subscription?.price?.product?.product_id === (product.product_id || product.id);
});
product.subscriptions = productSubscriptions;
}
return products;
return {
...product,
subscriptions: productSubscriptions
};
});
}
get customer() {

View File

@ -151,6 +151,8 @@ describe('Acceptance: Member details', function () {
expect(findAll('[data-test-subscription]').length, 'displays all member subscriptions')
.to.equal(2);
await click('[data-test-button="save"]');
expect(find('[data-test-button="save"]')).to.not.contain.text('Retry');
});
it('displays correctly one canceled subscription', async function () {