mirror of
https://github.com/TryGhost/Ghost.git
synced 2024-11-27 10:42:45 +03:00
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:
parent
0144ad1f7e
commit
ed8a3ca27c
@ -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;
|
||||
});
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user