mirror of
https://github.com/TryGhost/Ghost.git
synced 2024-12-25 03:44:29 +03:00
Fixed product benefits not loaded on memberships settings
refs https://github.com/TryGhost/Team/issues/905 - benefits were overridden with a secondary products query for segment select which did not have proper includes - fixes includes for products when fetched for member segments
This commit is contained in:
parent
2b0d1ee357
commit
03b37b05fb
@ -97,7 +97,7 @@ export default class GhMembersSegmentSelect extends Component {
|
||||
if (this.feature.get('multipleProducts')) {
|
||||
// fetch all products w̶i̶t̶h̶ c̶o̶u̶n̶t̶s̶
|
||||
// TODO: add `include: 'count.members` to query once API supports
|
||||
const products = yield this.store.query('product', {limit: 'all'});
|
||||
const products = yield this.store.query('product', {limit: 'all', include: 'monthly_price,yearly_price,benefits'});
|
||||
|
||||
if (products.length > 0) {
|
||||
const productsGroup = {
|
||||
|
@ -3,13 +3,12 @@ import Transform from '@ember-data/serializer/transform';
|
||||
import {A as emberA, isArray as isEmberArray} from '@ember/array';
|
||||
|
||||
export default Transform.extend({
|
||||
deserialize(serialized, options) {
|
||||
deserialize(serialized) {
|
||||
let benefitsItems, benefitsArray;
|
||||
|
||||
benefitsArray = serialized || [];
|
||||
|
||||
benefitsItems = benefitsArray.map((itemDetails) => {
|
||||
itemDetails.isSecondary = options && options.isSecondary || false;
|
||||
return ProductBenefitItem.create(itemDetails);
|
||||
});
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user