mirror of
https://github.com/TryGhost/Ghost.git
synced 2024-12-26 04:13:30 +03:00
🐛 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:
parent
1832e7dc93
commit
7080505004
@ -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() {
|
||||
|
@ -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 () {
|
||||
|
Loading…
Reference in New Issue
Block a user