From 1de88f7397e9b33b3509ad45de572fb0f99aeeb2 Mon Sep 17 00:00:00 2001 From: Fabien O'Carroll Date: Wed, 23 Jun 2021 10:18:15 +0100 Subject: [PATCH] Included `products` when exporting member csv refs https://github.com/TryGhost/Team/issues/765 Since Members can be given complimentary access to one of many products, we must include which products a member has access to when exporting from Ghost. This will allow us to reimport without losing information. --- core/server/api/canary/members.js | 3 +++ 1 file changed, 3 insertions(+) diff --git a/core/server/api/canary/members.js b/core/server/api/canary/members.js index dd3bca05db..3ac015a1d4 100644 --- a/core/server/api/canary/members.js +++ b/core/server/api/canary/members.js @@ -448,6 +448,9 @@ module.exports = { validation: {}, async query(frame) { frame.options.withRelated = ['labels', 'stripeSubscriptions', 'stripeSubscriptions.customer']; + if (labsService.isSet('multipleProducts')) { + frame.options.withRelated.push('products'); + } const page = await membersService.api.members.list(frame.options); return page;