mirror of
https://github.com/TryGhost/Ghost.git
synced 2025-01-06 22:40:14 -05:00
Cleaned up leftover "product" variable naming
refs https://github.com/TryGhost/Team/issues/1076 - "product" in the context of members has been deprecated since introduction of "tiers"
This commit is contained in:
parent
840deaf8d7
commit
59209a07a5
2 changed files with 6 additions and 6 deletions
|
@ -109,7 +109,7 @@ module.exports = class MembersCSVImporter {
|
|||
|
||||
const membersApi = await this._getMembersApi();
|
||||
|
||||
const defaultProduct = await membersApi.productRepository.getDefaultProduct();
|
||||
const defaultTier = await membersApi.productRepository.getDefaultProduct();
|
||||
|
||||
const result = await rows.reduce(async (resultPromise, row) => {
|
||||
const resultAccumulator = await resultPromise;
|
||||
|
@ -160,7 +160,7 @@ module.exports = class MembersCSVImporter {
|
|||
}, options);
|
||||
} else if (row.complimentary_plan) {
|
||||
await membersApi.members.update({
|
||||
products: [{id: defaultProduct.id}]
|
||||
products: [{id: defaultTier.id}]
|
||||
}, {
|
||||
...options,
|
||||
id: member.id
|
||||
|
|
|
@ -44,8 +44,8 @@ describe('Importer', function () {
|
|||
|
||||
// @NOTE: this is way too much mocking! the MembersCSVImporter constructor API should be simplified
|
||||
const buildMockImporterInstance = () => {
|
||||
const defaultProduct = {
|
||||
id: 'default_product_id'
|
||||
const defaultTier = {
|
||||
id: 'default_tier_id'
|
||||
};
|
||||
|
||||
memberCreateStub = sinon.stub().resolves({
|
||||
|
@ -54,7 +54,7 @@ describe('Importer', function () {
|
|||
membersApiStub = {
|
||||
productRepository: {
|
||||
getDefaultProduct: async () => {
|
||||
return defaultProduct;
|
||||
return defaultTier;
|
||||
}
|
||||
},
|
||||
members: {
|
||||
|
@ -203,7 +203,7 @@ describe('Importer', function () {
|
|||
// complimentary_plan import
|
||||
membersApiStub.members.update.calledOnce.should.be.true();
|
||||
should.deepEqual(membersApiStub.members.update.args[0][0].products, [{
|
||||
id: 'default_product_id'
|
||||
id: 'default_tier_id'
|
||||
}]);
|
||||
should.deepEqual(membersApiStub.members.update.args[0][1].id, 'test_member_id');
|
||||
});
|
||||
|
|
Loading…
Reference in a new issue