From 0cc147ae2dec36fd2677782ec2c68f58de5b0420 Mon Sep 17 00:00:00 2001 From: Kevin Ansfield Date: Thu, 17 Mar 2022 10:57:59 +0000 Subject: [PATCH] =?UTF-8?q?=F0=9F=90=9B=20Fixed=20member=20"last=20seen=20?= =?UTF-8?q?at"=20data=20not=20being=20returned=20in=20the=20API?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit refs https://github.com/TryGhost/Ghost/commit/c4470ff732c9b5733e7ffa6ce0cdd249947a8fca - labs flag was removed under the false assumption it was a client-side only flag but the `last_seen_at` property in API responses was also gated meaning the member details screen showed "Not seen yet" and the members list did not show the last seen date of all members when filtering --- core/server/api/canary/utils/serializers/output/members.js | 7 ++----- test/e2e-api/admin/legacy-members.test.js | 1 - test/e2e-api/admin/members.test.js | 2 -- 3 files changed, 2 insertions(+), 8 deletions(-) diff --git a/core/server/api/canary/utils/serializers/output/members.js b/core/server/api/canary/utils/serializers/output/members.js index c5604ea144..e23b8be634 100644 --- a/core/server/api/canary/utils/serializers/output/members.js +++ b/core/server/api/canary/utils/serializers/output/members.js @@ -124,13 +124,10 @@ function serializeMember(member, options) { email_opened_count: json.email_opened_count, email_open_rate: json.email_open_rate, email_recipients: json.email_recipients, - status: json.status + status: json.status, + last_seen_at: json.last_seen_at }; - if (labs.isSet('membersLastSeenFilter')) { - serialized.last_seen_at = json.last_seen_at; - } - if (json.products) { serialized.products = json.products; } diff --git a/test/e2e-api/admin/legacy-members.test.js b/test/e2e-api/admin/legacy-members.test.js index ee7f58251f..5212f80c5e 100644 --- a/test/e2e-api/admin/legacy-members.test.js +++ b/test/e2e-api/admin/legacy-members.test.js @@ -14,7 +14,6 @@ describe('Legacy Members API', function () { beforeEach(function () { mockManager.mockLabsDisabled('multipleProducts'); - mockManager.mockLabsEnabled('membersLastSeenFilter'); }); afterEach(function () { diff --git a/test/e2e-api/admin/members.test.js b/test/e2e-api/admin/members.test.js index 9f95631012..f074d7b5eb 100644 --- a/test/e2e-api/admin/members.test.js +++ b/test/e2e-api/admin/members.test.js @@ -53,7 +53,6 @@ describe('Members API without Stripe', function () { }); beforeEach(function () { - mockManager.mockLabsEnabled('membersLastSeenFilter'); mockManager.mockMail(); }); @@ -91,7 +90,6 @@ describe('Members API', function () { beforeEach(function () { mockManager.mockLabsEnabled('multipleProducts'); - mockManager.mockLabsEnabled('membersLastSeenFilter'); mockManager.mockStripe(); mockManager.mockMail(); });