0
Fork 0
mirror of https://github.com/TryGhost/Ghost.git synced 2025-02-10 23:36:14 -05:00

Updated create & update to accept products

refs https://github.com/TryGhost/Team/issues/748

This allows us to start modifying products directly in order to give
complimentary access without using Stripe
This commit is contained in:
Fabien O'Carroll 2021-06-10 17:39:49 +01:00 committed by Fabien 'egg' O'Carroll
parent f6e12a3da7
commit 11067c4b08

View file

@ -68,7 +68,7 @@ module.exports = class MemberRepository {
}); });
} }
const memberData = _.pick(data, ['email', 'name', 'note', 'subscribed', 'geolocation', 'created_at']); const memberData = _.pick(data, ['email', 'name', 'note', 'subscribed', 'geolocation', 'created_at', 'products']);
const member = await this._Member.add({ const member = await this._Member.add({
...memberData, ...memberData,
@ -110,7 +110,8 @@ module.exports = class MemberRepository {
'note', 'note',
'subscribed', 'subscribed',
'labels', 'labels',
'geolocation' 'geolocation',
'products'
]), options); ]), options);
// member._changed.subscribed has a value if the `subscribed` attribute is passed in the update call, regardless of the previous value // member._changed.subscribed has a value if the `subscribed` attribute is passed in the update call, regardless of the previous value