0
Fork 0
mirror of https://github.com/TryGhost/Ghost.git synced 2025-01-06 22:40:14 -05:00

Exposed dummy subscriptions to theme layer (#13257)

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

This updates the @tryghost/members-api module to return the full member
object from getMemberIdentityData, which is used to populate req.member
used by themes to construct the `@member` template data.

The full object is read from the service which handles all additional
properties and logic for retrieving members, including the dummy
subscriptions for comped members.
This commit is contained in:
Fabien 'egg' O'Carroll 2021-08-26 17:03:32 +02:00 committed by GitHub
parent e05fa6af38
commit 9a1417c8b9
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 7 additions and 7 deletions

View file

@ -73,7 +73,7 @@
"@tryghost/limit-service": "0.6.1",
"@tryghost/logging": "0.1.5",
"@tryghost/magic-link": "1.0.10",
"@tryghost/members-api": "1.27.3",
"@tryghost/members-api": "1.28.0",
"@tryghost/members-csv": "1.1.5",
"@tryghost/members-importer": "0.3.1",
"@tryghost/members-ssr": "1.0.11",

View file

@ -118,7 +118,7 @@ describe('Members API', function () {
should.exist(jsonResponse);
should.exist(jsonResponse.members);
jsonResponse.members.should.have.length(1);
localUtils.API.checkResponse(jsonResponse.members[0], 'member', 'subscriptions');
localUtils.API.checkResponse(jsonResponse.members[0], 'member', ['subscriptions', 'products']);
});
it('Can read and include email_recipients', async function () {
@ -134,7 +134,7 @@ describe('Members API', function () {
should.exist(jsonResponse);
should.exist(jsonResponse.members);
jsonResponse.members.should.have.length(1);
localUtils.API.checkResponse(jsonResponse.members[0], 'member', ['subscriptions', 'email_recipients']);
localUtils.API.checkResponse(jsonResponse.members[0], 'member', ['subscriptions', 'email_recipients', 'products']);
jsonResponse.members[0].email_recipients.length.should.equal(1);
localUtils.API.checkResponse(jsonResponse.members[0].email_recipients[0], 'email_recipient', ['email']);
localUtils.API.checkResponse(jsonResponse.members[0].email_recipients[0].email, 'email');

View file

@ -908,10 +908,10 @@
jsonwebtoken "^8.5.1"
lodash "^4.17.15"
"@tryghost/members-api@1.27.3":
version "1.27.3"
resolved "https://registry.yarnpkg.com/@tryghost/members-api/-/members-api-1.27.3.tgz#04e32e785252131bdece6e9a759de0bc06d1c993"
integrity sha512-NnzZMJBPsifx35kf04VCjJTJO5KmH1qWky0/TchQOlQhfrZpNuA72sykVdFc/IPGseRGCu6ANMRUKBW8N8X/9w==
"@tryghost/members-api@1.28.0":
version "1.28.0"
resolved "https://registry.yarnpkg.com/@tryghost/members-api/-/members-api-1.28.0.tgz#97b4ebf826f0b6f34cd6eb4affe8ee77c369a2b6"
integrity sha512-1uEp3D47B+4574UPEhrquyXry6rMN6odl8N8uciu6zXvDDK6SDqnS68EevrerDJyT0nKd8cq4r+JBpr+kcUCfg==
dependencies:
"@tryghost/debug" "^0.1.2"
"@tryghost/errors" "^0.2.9"