mirror of
https://github.com/TryGhost/Ghost.git
synced 2025-01-01 23:37:43 +03:00
Added support for importing products
column
refs https://github.com/TryGhost/Team/issues/765 This supercedes the `complimentary_plan` flag, as it is more precise because it determines _which_ product(s) a member has access to. Because of this, if the `products` column is present the `complimentary_plan` column is not used.
This commit is contained in:
parent
1de88f7397
commit
c46542532d
@ -150,7 +150,7 @@ module.exports = class MembersCSVImporter {
|
||||
} else if (row.complimentary_plan) {
|
||||
if (!labsService.isSet('multipleProducts')) {
|
||||
await membersApi.members.setComplimentarySubscription(member, options);
|
||||
} else {
|
||||
} else if (!row.products) {
|
||||
await membersApi.members.update({
|
||||
products: [{id: defaultProduct.id}]
|
||||
}, {
|
||||
@ -160,6 +160,17 @@ module.exports = class MembersCSVImporter {
|
||||
}
|
||||
}
|
||||
|
||||
if (labsService.isSet('multipleProducts')) {
|
||||
if (row.products) {
|
||||
await membersApi.members.update({
|
||||
products: row.products
|
||||
}, {
|
||||
...options,
|
||||
id: member.id
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
await trx.commit();
|
||||
return {
|
||||
...resultAccumulator,
|
||||
|
Loading…
Reference in New Issue
Block a user