Updated browse to not include products by default

no-issue

The Members API does not currently include 'products' by default when
browsing. This ensures the functionality is maintained.
This commit is contained in:
Fabien O'Carroll 2021-10-25 13:34:20 +02:00
parent 0144ad1f7e
commit ed8a3ca27c

View File

@ -293,7 +293,9 @@ module.exports = class MemberBREADService {
'products'
];
const withRelated = new Set((options.withRelated || []).concat(defaultWithRelated));
const originalWithRelated = options.withRelated || [];
const withRelated = new Set((originalWithRelated).concat(defaultWithRelated));
if (!withRelated.has('productEvents')) {
withRelated.add('productEvents');
@ -316,6 +318,9 @@ module.exports = class MemberBREADService {
const data = members.map((member) => {
this.attachSubscriptionsToMember(member);
if (!originalWithRelated.includes('products')) {
delete member.products;
}
return member;
});