Moved the last_seen_at api property behind a flag

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

- Prevents any issue from reaching all Ghost users
This commit is contained in:
Thibaut Patel 2022-02-24 17:28:07 +01:00
parent 3bd8e01495
commit ebab652919
2 changed files with 7 additions and 1 deletions

View File

@ -1,6 +1,7 @@
//@ts-check
const debug = require('@tryghost/debug')('api:canary:utils:serializers:output:members');
const {unparse} = require('@tryghost/members-csv');
const labs = require('../../../../../../shared/labs');
module.exports = {
hasActiveStripeSubscriptions: createSerializer('hasActiveStripeSubscriptions', passthrough),
@ -124,10 +125,13 @@ function serializeMember(member, options) {
email_opened_count: json.email_opened_count,
email_open_rate: json.email_open_rate,
email_recipients: json.email_recipients,
last_seen_at: json.last_seen_at,
status: json.status
};
if (labs.isSet('membersLastSeenFilter')) {
serialized.last_seen_at = json.last_seen_at;
}
if (json.products) {
serialized.products = json.products;
}

View File

@ -53,6 +53,7 @@ describe('Members API without Stripe', function () {
});
beforeEach(function () {
mockManager.mockLabsEnabled('membersLastSeenFilter');
mockManager.mockMail();
});
@ -90,6 +91,7 @@ describe('Members API', function () {
beforeEach(function () {
mockManager.mockLabsEnabled('multipleProducts');
mockManager.mockLabsEnabled('membersLastSeenFilter');
mockManager.mockStripe();
mockManager.mockMail();
});